Skip to content

Commit 8953c4b

Browse files
easyCZroboquat
authored andcommitted
[db] Add deleted column to d_b_prebuilt_workspace
1 parent e1985ce commit 8953c4b

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
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+
import { columnExists } from "./helper/helper";
9+
10+
const TABLE_NAME = "d_b_prebuilt_workspace";
11+
const COLUMN_NAME = "deleted";
12+
13+
export class PrebuildWorkspaceDBSync1663751455102 implements MigrationInterface {
14+
public async up(queryRunner: QueryRunner): Promise<void> {
15+
if (!(await columnExists(queryRunner, TABLE_NAME, COLUMN_NAME))) {
16+
await queryRunner.query(
17+
`ALTER TABLE ${TABLE_NAME} ADD COLUMN \`${COLUMN_NAME}\` tinyint(4) NOT NULL DEFAULT '0', ALGORITHM=INPLACE, LOCK=NONE`,
18+
);
19+
}
20+
}
21+
22+
public async down(queryRunner: QueryRunner): Promise<void> {}
23+
}

0 commit comments

Comments
 (0)