Files
twenty/packages/twenty-server/test/integration/utils/setup-test.ts
T
Charles BochetandGitHub f6423f5925 Remove DataSourceService and clean up datasource migration logic (#19532)
## Summary

- **Drop the `objectMetadata.dataSourceId` foreign key and index** via a
1-22 fast instance command — column kept nullable for data preservation
- **Delete `DataSourceService`, `DataSourceModule`, and
`DataSourceException`** — all code now uses `workspace.databaseSchema`
directly
- **Remove `IS_DATASOURCE_MIGRATED` feature flag** from default flags
and all branching logic
- **Simplify workspace/object creation pipelines** —
`WorkspaceManagerService`, `DevSeederService`, and the object creation
action handler no longer route through `DataSourceService`
- **Keep `DataSourceEntity` and the `dataSource` table** for historical
data — entity stripped of all ORM relations
2026-04-10 07:34:05 +00:00

24 lines
746 B
TypeScript

import { type JestConfigWithTsJest } from 'ts-jest';
import 'tsconfig-paths/register';
import { DataSeedWorkspaceCommand } from 'src/database/commands/data-seed-dev-workspace.command';
import { rawDataSource } from 'src/database/typeorm/raw/raw.datasource';
import { createApp } from './create-app';
export default async (_: unknown, projectConfig: JestConfigWithTsJest) => {
const app = await createApp({});
if (!projectConfig.globals) {
throw new Error('No globals found in project config');
}
await rawDataSource.initialize();
await app.listen(projectConfig.globals.APP_PORT as number);
global.app = app;
global.testDataSource = rawDataSource;
global.dataSeedWorkspaceCommand = app.get(DataSeedWorkspaceCommand);
};