File tree Expand file tree Collapse file tree 2 files changed +20
-1
lines changed
components/gitpod-db/src/typeorm/migration Expand file tree Collapse file tree 2 files changed +20
-1
lines changed Original file line number Diff line number Diff line change
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 { tableExists } from "./helper/helper" ;
9
+
10
+ export class DropBilledSessionTable1663572136760 implements MigrationInterface {
11
+ public async up ( queryRunner : QueryRunner ) : Promise < void > {
12
+ const TABLE_NAME = "d_b_billed_session" ;
13
+ if ( await tableExists ( queryRunner , TABLE_NAME ) ) {
14
+ await queryRunner . query ( `DROP TABLE \`${ TABLE_NAME } \`` ) ;
15
+ }
16
+ }
17
+
18
+ public async down ( queryRunner : QueryRunner ) : Promise < void > { }
19
+ }
Original file line number Diff line number Diff line change 3
3
To create a new migration file, run this command in the ` gitpod-db ` component directory:
4
4
5
5
```
6
- yarn typeorm migrations :create -n NameOfYourMigration
6
+ yarn typeorm migration :create -n NameOfYourMigration
7
7
leeway run components:update-license-header
8
8
```
9
9
You can’t perform that action at this time.
0 commit comments