Skip to content

Commit 9baff6b

Browse files
Andrew Farriesroboquat
Andrew Farries
authored andcommitted
Add migration to change primary key
1 parent da562a4 commit 9baff6b

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/**
2+
* Copyright (c) 2022 Gitpod GmbH. All rights reserved.
3+
* Licensed under the GNU Affero General Public License (AGPL).
4+
* See License-AGPL.txt in the project root for license information.
5+
*/
6+
7+
import { MigrationInterface, QueryRunner } from "typeorm";
8+
9+
export class ChangeWorkspaceClusterTablePK1666611052662 implements MigrationInterface {
10+
public async up(queryRunner: QueryRunner): Promise<void> {
11+
await queryRunner.query(`ALTER TABLE d_b_workspace_cluster DROP PRIMARY KEY`);
12+
await queryRunner.query(`ALTER TABLE d_b_workspace_cluster ADD PRIMARY KEY (name, applicationCluster)`);
13+
}
14+
15+
public async down(queryRunner: QueryRunner): Promise<void> {}
16+
}

0 commit comments

Comments
 (0)