Skip to content

Commit

Permalink
[server, usage, db] Drop CostCenter.deleted (not used) (#18809)
Browse files Browse the repository at this point in the history
  • Loading branch information
geropl authored Sep 27, 2023
1 parent 2ba3475 commit 2c7c770
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
1 change: 0 additions & 1 deletion components/gitpod-db/src/tables.ts
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,6 @@ export class GitpodTableDescriptionProvider implements TableDescriptionProvider
{
name: "d_b_cost_center",
primaryKeys: ["id", "creationTime"],
deletionColumn: "deleted",
timeColumn: "_lastModified",
},
{
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/**
* Copyright (c) 2023 Gitpod GmbH. All rights reserved.
* Licensed under the GNU Affero General Public License (AGPL).
* See License.AGPL.txt in the project root for license information.
*/

import { MigrationInterface, QueryRunner } from "typeorm";
import { columnExists } from "./helper/helper";

export class CostCenterDropDeleted1695735203768 implements MigrationInterface {
public async up(queryRunner: QueryRunner): Promise<void> {
if (await columnExists(queryRunner, "d_b_cost_center", "deleted")) {
await queryRunner.query("ALTER TABLE `d_b_cost_center` DROP COLUMN `deleted`, ALGORITHM=INSTANT");
}
}

public async down(queryRunner: QueryRunner): Promise<void> {
if (!(await columnExists(queryRunner, "d_b_cost_center", "deleted"))) {
await queryRunner.query(
"ALTER TABLE `d_b_cost_center` ADD COLUMN `deleted` tinyint(4) NOT NULL DEFAULT '0', ALGORITHM=INSTANT",
);
}
}
}

0 comments on commit 2c7c770

Please sign in to comment.