Skip to content

Commit f44d1ba

Browse files
authored
[db] check if table exists before creating (#18014)
1 parent 673ac4d commit f44d1ba

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

components/gitpod-db/src/typeorm/migration/1686907204398-FreeCredits.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,14 @@
55
*/
66

77
import { MigrationInterface, QueryRunner } from "typeorm";
8+
import { tableExists } from "./helper/helper";
89

910
export class FreeCredits1686907204398 implements MigrationInterface {
1011
public async up(queryRunner: QueryRunner): Promise<void> {
12+
if (await tableExists(queryRunner, "d_b_free_credits")) {
13+
return;
14+
}
15+
1116
await queryRunner.query(
1217
`
1318
CREATE TABLE d_b_free_credits (

0 commit comments

Comments
 (0)