Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .claude/docs/synchronizer-model.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Each artefact type has three collaborating pieces:
2. A **Synchronizer** (`extends BaseSynchronizer<A, ID>` or `MultitenantBaseSynchronizer`) — registered as a Spring bean, scans the repository for a specific file extension/pattern, parses it, upserts the artefact, and reacts to lifecycle phases (`CREATE`, `UPDATE`, `DELETE`, `START`, `STOP`). Ordering across synchronizer types is fixed in `SynchronizersOrder`.
3. An optional **engine/service/endpoint** that consumes the live artefact (e.g. Quartz scheduler for jobs, Flowable for `.bpmn`, Camel for routes, Spring MVC endpoints for `expose` declarations).

Existing synchronizer implementations (grep `extends BaseSynchronizer` / `extends MultitenantBaseSynchronizer`) give a complete inventory of supported artefact types: `Job`, `Bpmn`, `Camel`, `Listener`, `Csvim`, `DataSource`, `Table`, `View`, `Access` (security), `Expose` (URL routing), `ExtensionPoint` / `Extension`, `Markdown`, `Proxy`, `PrintTemplate` (`.print` → CMS seeding), etc. Adding a new artefact type means producing a new synchronizer + entity + (usually) a service, then registering it in the relevant `group-*` aggregator.
Existing synchronizer implementations (grep `extends BaseSynchronizer` / `extends MultitenantBaseSynchronizer`) give a complete inventory of supported artefact types: `Job`, `Bpmn`, `Camel`, `Listener`, `Csvim`, `DataSource`, `Table`, `View`, `Access` (security), `Expose` (URL routing), `ExtensionPoint` / `Extension`, `Markdown`, `Proxy`, `PrintTemplate` (`.print` → CMS seeding), `Migration` (`.migration` → a data migration applied once per tenant schema, recorded in that schema's `DIRIGIBLE_MIGRATIONS`), etc. Adding a new artefact type means producing a new synchronizer + entity + (usually) a service, then registering it in the relevant `group-*` aggregator.

JS/TS user code is **not** synchronized — it is loaded on demand by `engine-javascript` (`JavascriptEndpoint` at `/services/js/...`, `/public/js/...`) via `DirigibleJavascriptCodeRunner` backed by Graalium/GraalVM polyglot. The `api-*` Java modules under `components/api/` register the JS-callable APIs (`@dirigible/db`, `@dirigible/http`, etc.) into the GraalJS context — pre-built TS/JS bundles for those APIs live in `components/api/api-modules-javascript/src/main/resources/META-INF/dirigible/modules/`.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,13 @@ public interface SynchronizersOrder {
/** The component. */
int COMPONENT = 250;

/**
* The data migration ({@code .migration}). After every synchronizer that evolves structure (schema,
* table, view, entity), so a migration finds the columns it backfills, and before the CSVIM seed,
* so a seed lands on migrated data.
*/
int MIGRATION = 260;

/** The bpmn. */
int BPMN = 300;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11283,6 +11283,218 @@
}
]
}
},
{
"changeSet": {
"id": "create-DIRIGIBLE_MIGRATION_FILES",
"author": "dirigible",
"preConditions": [
{
"onFail": "MARK_RAN"
},
{
"not": [
{
"tableExists": {
"tableName": "DIRIGIBLE_MIGRATION_FILES"
}
}
]
}
],
"changes": [
{
"createTable": {
"columns": [
{
"column": {
"autoIncrement": true,
"constraints": {
"nullable": false,
"primaryKey": true,
"primaryKeyName": "PK_DIRIGIBLE_MIGRATION_FILES"
},
"name": "MIGRATION_ID",
"type": "BIGINT"
}
},
{
"column": {
"name": "CREATED_AT",
"type": "TIMESTAMP"
}
},
{
"column": {
"name": "CREATED_BY",
"type": "CLOB"
}
},
{
"column": {
"name": "UPDATED_AT",
"type": "TIMESTAMP"
}
},
{
"column": {
"name": "UPDATED_BY",
"type": "CLOB"
}
},
{
"column": {
"name": "ARTEFACT_DEPENDENCIES",
"type": "CLOB"
}
},
{
"column": {
"name": "ARTEFACT_DESCRIPTION",
"type": "CLOB"
}
},
{
"column": {
"name": "ARTEFACT_ERROR",
"type": "CLOB"
}
},
{
"column": {
"constraints": {
"nullable": false
},
"name": "ARTEFACT_KEY",
"type": "VARCHAR(2000)"
}
},
{
"column": {
"name": "ARTEFACT_STATUS",
"type": "CLOB"
}
},
{
"column": {
"constraints": {
"nullable": false
},
"name": "ARTEFACT_LOCATION",
"type": "CLOB"
}
},
{
"column": {
"constraints": {
"nullable": false
},
"name": "ARTEFACT_NAME",
"type": "CLOB"
}
},
{
"column": {
"name": "ARTEFACT_PHASE",
"type": "CLOB"
}
},
{
"column": {
"name": "ARTEFACT_RUNNING",
"type": "BOOLEAN"
}
},
{
"column": {
"constraints": {
"nullable": false
},
"name": "ARTEFACT_TYPE",
"type": "CLOB"
}
},
{
"column": {
"constraints": {
"nullable": false
},
"name": "MIGRATION_PROJECT",
"type": "VARCHAR(255)"
}
},
{
"column": {
"constraints": {
"nullable": false
},
"name": "MIGRATION_VERSION",
"type": "VARCHAR(64)"
}
},
{
"column": {
"constraints": {
"nullable": false
},
"name": "MIGRATION_SCOPE",
"type": "VARCHAR(16)"
}
},
{
"column": {
"constraints": {
"nullable": false
},
"name": "MIGRATION_IDEMPOTENT",
"type": "BOOLEAN"
}
},
{
"column": {
"constraints": {
"nullable": false
},
"name": "MIGRATION_CHECKSUM",
"type": "VARCHAR(64)"
}
}
],
"tableName": "DIRIGIBLE_MIGRATION_FILES"
}
}
]
}
},
{
"changeSet": {
"id": "UK_DIRIGIBLE_MIGRATION_FILES_ARTEFACT_KEY",
"author": "dirigible",
"preConditions": [
{
"onFail": "MARK_RAN"
},
{
"not": [
{
"uniqueConstraintExists": {
"tableName": "DIRIGIBLE_MIGRATION_FILES",
"constraintName": "UK_DIRIGIBLE_MIGRATION_FILES_ARTEFACT_KEY"
}
}
]
}
],
"changes": [
{
"addUniqueConstraint": {
"columnNames": "ARTEFACT_KEY",
"constraintName": "UK_DIRIGIBLE_MIGRATION_FILES_ARTEFACT_KEY",
"tableName": "DIRIGIBLE_MIGRATION_FILES"
}
}
]
}
}
]
}
53 changes: 53 additions & 0 deletions components/data/data-migrations/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>org.eclipse.dirigible</groupId>
<artifactId>dirigible-components-parent</artifactId>
<version>15.0.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>

<name>Components - Data - Migrations</name>
<artifactId>dirigible-components-data-migrations</artifactId>
<packaging>jar</packaging>

<dependencies>
<dependency>
<groupId>org.eclipse.dirigible</groupId>
<artifactId>dirigible-components-core-base</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.dirigible</groupId>
<artifactId>dirigible-components-core-repository</artifactId>
</dependency>
<!-- The per-tenant ledger and the scripts run on the tenant-routed default datasource -->
<dependency>
<groupId>org.eclipse.dirigible</groupId>
<artifactId>dirigible-components-data-sources</artifactId>
</dependency>
<!-- ScriptUtils: statement splitting that honours comments and quoted literals -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jdbc</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-health</artifactId>
</dependency>

<!-- The executor's tests run on a real in-memory database: transactions are what they test -->
<dependency>
<groupId>org.eclipse.dirigible</groupId>
<artifactId>dirigible-database-sql-h2</artifactId>
<scope>test</scope>
</dependency>
</dependencies>

<properties>
<license.header.location>../../../licensing-header.txt</license.header.location>
<parent.pom.folder>../../../</parent.pom.folder>
</properties>

</project>
Loading
Loading