Skip to content

Commit 0fecdd4

Browse files
committed
[db] add migration
1 parent aa7482e commit 0fecdd4

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/**
2+
* Copyright (c) 2023 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, tableExists } from "./helper/helper";
9+
10+
export class AddOrgDefaultImageSetting1694775547603 implements MigrationInterface {
11+
public async up(queryRunner: QueryRunner): Promise<void> {
12+
if (await tableExists(queryRunner, "d_b_org_settings")) {
13+
if (!(await columnExists(queryRunner, "d_b_org_settings", "d_b_org_settings"))) {
14+
await queryRunner.query(
15+
"ALTER TABLE `d_b_org_settings` ADD COLUMN `defaultWorkspaceImage` varchar(255) NULL",
16+
);
17+
}
18+
}
19+
}
20+
21+
public async down(queryRunner: QueryRunner): Promise<void> {}
22+
}

0 commit comments

Comments
 (0)