mirror of
https://github.com/ToolJet/ToolJet
synced 2026-04-21 21:47:17 +00:00
* add migrations for versioning datasources and dataqueries * eslint migrations folder * update ormconfig to use app context in migrations * make app to make use versioned data sources and queries in editor * app import should honor data source and query versioning * register ts-node path on running migrations * load data queries when finding versions * update e2e tests * handle for invalid oauth2 datasources * update e2e tests * introduce db migrations access lock to handle concurrent backfill * scope migrations by missing version id * fix import export without data source/query versions * fix import * fix spec * handle invalid data on migration * fix import * remove console logs * handle new app imports * fix version check * fix async creation * explicitly add timestamps on version import
27 lines
793 B
TypeScript
27 lines
793 B
TypeScript
import { MigrationInterface, QueryRunner, TableColumn, TableForeignKey } from 'typeorm';
|
|
|
|
export class AddAppVersionIdColumnToDataSources1639645231497 implements MigrationInterface {
|
|
public async up(queryRunner: QueryRunner): Promise<void> {
|
|
await queryRunner.addColumn(
|
|
'data_sources',
|
|
new TableColumn({
|
|
name: 'app_version_id',
|
|
type: 'uuid',
|
|
isNullable: true,
|
|
})
|
|
);
|
|
|
|
await queryRunner.createForeignKey(
|
|
'data_sources',
|
|
new TableForeignKey({
|
|
columnNames: ['app_version_id'],
|
|
referencedColumnNames: ['id'],
|
|
referencedTableName: 'app_versions',
|
|
})
|
|
);
|
|
}
|
|
|
|
public async down(queryRunner: QueryRunner): Promise<void> {
|
|
await queryRunner.dropColumn('data_sources', 'app_version_id');
|
|
}
|
|
}
|