Deprecate dataSource table with dual-write to workspace.databaseSchema (#19059)

## Summary
- Starts deprecation of the `core.dataSource` table by introducing a
dual-write system: `DataSourceService.createDataSourceMetadata` now
writes to both `core.dataSource` and `core.workspace.databaseSchema`
- Migrates read sites (`WorkspaceDataSourceService.checkSchemaExists`,
`WorkspaceSchemaFactory`, `MiddlewareService`,
`WorkspacesMigrationCommandRunner`) to read from
`workspace.databaseSchema` instead of querying the `dataSource` table
- Removes the unused `databaseUrl` field from `WorkspaceEntity` and
drops the column via migration
- Adds a 1.20 upgrade command to backfill `workspace.databaseSchema`
from `dataSource.schema` for existing workspaces
This commit is contained in:
Charles Bochet
2026-03-28 11:29:19 +01:00
committed by GitHub
parent cb44b22e15
commit 81fc960712
18 changed files with 161 additions and 42 deletions
@@ -234,13 +234,9 @@ export class WorkspaceEntity {
@Column({ default: 1 })
metadataVersion: number;
@Field()
@Column({ default: '' })
databaseUrl: string;
@Field()
@Column({ default: '' })
databaseSchema: string;
@Field(() => String, { nullable: true })
@Column({ type: 'varchar', nullable: true, default: null })
databaseSchema: string | null;
@Field()
@Column({ unique: true })