Skip to content

Commit 584e822

Browse files
author
Andrew Farries
committed
Add _lastModified column to d_b_workspace_cluster
So that it can be synced with `db-sync.`
1 parent b34bc3f commit 584e822

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
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+
9+
const TABLE_NAME = "d_b_workspace_cluster";
10+
const COLUMN_NAME = "_lastModified";
11+
12+
export class AddLastModifiedToWorkspaceClusterTable1666616345054 implements MigrationInterface {
13+
public async up(queryRunner: QueryRunner): Promise<void> {
14+
await queryRunner.query(
15+
`ALTER TABLE ${TABLE_NAME} ADD COLUMN ${COLUMN_NAME} timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6), ALGORITHM=INPLACE, LOCK=NONE `,
16+
);
17+
}
18+
19+
public async down(queryRunner: QueryRunner): Promise<void> {}
20+
}

0 commit comments

Comments
 (0)