Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[server, usage, db] Drop CostCenter.deleted (not used) #18809

Merged
merged 1 commit into from
Sep 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd rather remove the whole entry for this table, as it is confusing to have it in the periodic deleter at all.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm looking into this in a separate branch already. 👍

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not for this, but for all entries here. Looks like most are outdated.

Copy link
Member

@svenefftinge svenefftinge Sep 26, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe while you are at it also delete the other useless entries (e.g. `d_b_usage' below)

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",
);
}
}
}
Loading