-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[server, usage, db] Drop CostCenter.deleted (not used) (#18809)
- Loading branch information
Showing
2 changed files
with
24 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
components/gitpod-db/src/typeorm/migration/1695735203768-CostCenterDropDeleted.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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", | ||
); | ||
} | ||
} | ||
} |