Skip to content

Commit d5987af

Browse files
Andrew Farriesroboquat
authored andcommitted
Move migration file to correct dir
1 parent e7e1f54 commit d5987af

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,22 @@
1-
import {MigrationInterface, QueryRunner} from "typeorm";
2-
import {columnExists} from "@gitpod/gitpod-db/lib/typeorm/migration/helper/helper";
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+
*/
36

4-
export class WorkspaceInstanceUsageAddExtraFields1658144661198 implements MigrationInterface {
7+
import { MigrationInterface, QueryRunner } from "typeorm";
8+
import { columnExists } from "./helper/helper";
59

10+
export class WorkspaceInstanceUsageAddExtraFields1658211404679 implements MigrationInterface {
611
public async up(queryRunner: QueryRunner): Promise<void> {
7-
8-
const columns = ['userId', 'workspaceId', 'projectId', 'workspaceType', 'workspaceClass'];
12+
const columns = ["userId", "workspaceId", "projectId", "workspaceType", "workspaceClass"];
913

1014
const statements = columns
11-
.filter(async col => {
12-
const exists = await columnExists(queryRunner, "d_b_workspace_instance_usage", col)
15+
.filter(async (col) => {
16+
const exists = await columnExists(queryRunner, "d_b_workspace_instance_usage", col);
1317
return !exists;
1418
})
15-
.map(col => {
19+
.map((col) => {
1620
return `ADD COLUMN ${col} varchar(255) NOT NULL DEFAULT ''`;
1721
});
1822

@@ -22,5 +26,4 @@ export class WorkspaceInstanceUsageAddExtraFields1658144661198 implements Migrat
2226
}
2327

2428
public async down(queryRunner: QueryRunner): Promise<void> {}
25-
2629
}

0 commit comments

Comments
 (0)