Skip to content

Commit 0a6e0b8

Browse files
Add optional tablesToken in Project table (#1617)
<!-- Ensure the title clearly reflects what was changed. Provide a clear and concise description of the changes made. The PR should only contain the changes related to the issue, and no other unrelated changes. --> Fixes OPS-3030 Review first: #1612
1 parent bf6d23c commit 0a6e0b8

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import { MigrationInterface, QueryRunner } from 'typeorm';
2+
3+
export class AddTablesTokenToProject1763131154284
4+
implements MigrationInterface
5+
{
6+
name = 'AddTablesTokenToProject1763131154284';
7+
8+
public async up(queryRunner: QueryRunner): Promise<void> {
9+
await queryRunner.query(`
10+
ALTER TABLE "project"
11+
ADD COLUMN IF NOT EXISTS "tablesToken" character varying NULL
12+
`);
13+
}
14+
15+
public async down(_: QueryRunner): Promise<void> {
16+
throw new Error('Rollback not implemented');
17+
}
18+
}

packages/server/api/src/app/database/postgres-connection.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ import { AddContentTypeToFolder1757331587268 } from './migrations/1757331587268-
3737
import { MigrateAiConfigToAppConnection1759242268873 } from './migrations/1759242268873-MigrateAiConfigToAppConnection';
3838
import { AddTestRunActionLimitsToFlowVersion1760429290001 } from './migrations/1760429290001-AddTestRunActionLimitsToFlowVersion';
3939
import { MoveTablesWorkspaceIdFromOrganizationToProject1760500000000 } from './migrations/1760500000000-MoveTablesWorkspaceIdFromOrganizationToProject';
40+
import { AddTablesTokenToProject1763131154284 } from './migrations/1763131154284-AddTablesTokenToProject';
4041

4142
const getSslConfig = (): boolean | TlsOptions => {
4243
const useSsl = system.get(AppSystemProp.POSTGRES_USE_SSL);
@@ -82,6 +83,7 @@ const getMigrations = (): (new () => MigrationInterface)[] => {
8283
MigrateAiConfigToAppConnection1759242268873,
8384
AddTestRunActionLimitsToFlowVersion1760429290001,
8485
MoveTablesWorkspaceIdFromOrganizationToProject1760500000000,
86+
AddTablesTokenToProject1763131154284,
8587
];
8688
};
8789

0 commit comments

Comments
 (0)