diff --git a/components/gitpod-db/src/typeorm/migration/1666611052662-ChangeWorkspaceClusterTablePK.ts b/components/gitpod-db/src/typeorm/migration/1666611052662-ChangeWorkspaceClusterTablePK.ts new file mode 100644 index 00000000000000..800a3f40aca471 --- /dev/null +++ b/components/gitpod-db/src/typeorm/migration/1666611052662-ChangeWorkspaceClusterTablePK.ts @@ -0,0 +1,16 @@ +/** + * Copyright (c) 2022 Gitpod GmbH. All rights reserved. + * Licensed under the GNU Affero General Public License (AGPL). + * See License-AGPL.txt in the project root for license information. + */ + +import { MigrationInterface, QueryRunner } from "typeorm"; + +export class ChangeWorkspaceClusterTablePK1666611052662 implements MigrationInterface { + public async up(queryRunner: QueryRunner): Promise { + await queryRunner.query(`ALTER TABLE d_b_workspace_cluster DROP PRIMARY KEY`); + await queryRunner.query(`ALTER TABLE d_b_workspace_cluster ADD PRIMARY KEY (name, applicationCluster)`); + } + + public async down(queryRunner: QueryRunner): Promise {} +}