Skip to content

Commit 1dabfa7

Browse files
easyCZroboquat
authored andcommitted
[db] Drop description column from d_b_personal_access_token
1 parent 7ef62ba commit 1dabfa7

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
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 { columnExists } from "./helper/helper";
9+
10+
const TABLE_NAME = "d_b_personal_access_token";
11+
const COLUMN_NAME = "description";
12+
13+
export class PersonalAccessTokenRemoveDescriptionColumn1669237520073 implements MigrationInterface {
14+
public async up(queryRunner: QueryRunner): Promise<void> {
15+
if (await columnExists(queryRunner, TABLE_NAME, COLUMN_NAME)) {
16+
await queryRunner.query(`ALTER TABLE ${TABLE_NAME} DROP COLUMN ${COLUMN_NAME}`);
17+
}
18+
}
19+
20+
public async down(queryRunner: QueryRunner): Promise<void> {}
21+
}

0 commit comments

Comments
 (0)