Skip to content

Commit

Permalink
[db] Add deleted column to d_b_prebuilt_workspace
Browse files Browse the repository at this point in the history
  • Loading branch information
easyCZ authored and roboquat committed Sep 21, 2022
1 parent e1985ce commit 8953c4b
Showing 1 changed file with 23 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/**
* 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";
import { columnExists } from "./helper/helper";

const TABLE_NAME = "d_b_prebuilt_workspace";
const COLUMN_NAME = "deleted";

export class PrebuildWorkspaceDBSync1663751455102 implements MigrationInterface {
public async up(queryRunner: QueryRunner): Promise<void> {
if (!(await columnExists(queryRunner, TABLE_NAME, COLUMN_NAME))) {
await queryRunner.query(
`ALTER TABLE ${TABLE_NAME} ADD COLUMN \`${COLUMN_NAME}\` tinyint(4) NOT NULL DEFAULT '0', ALGORITHM=INPLACE, LOCK=NONE`,
);
}
}

public async down(queryRunner: QueryRunner): Promise<void> {}
}

0 comments on commit 8953c4b

Please sign in to comment.