Skip to content

Commit

Permalink
Fix compatibility issues with db-migration (#18831)
Browse files Browse the repository at this point in the history
  • Loading branch information
iQQBot authored Sep 28, 2023
1 parent 3c4818f commit d18ee26
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,22 @@ import { columnExists } from "./helper/helper";
export class CodeSyncDropDeleted1695733993909 implements MigrationInterface {
public async up(queryRunner: QueryRunner): Promise<void> {
if (await columnExists(queryRunner, "d_b_code_sync_resource", "deleted")) {
await queryRunner.query("ALTER TABLE `d_b_code_sync_resource` DROP COLUMN `deleted`, ALGORITHM=INSTANT");
await queryRunner.query("ALTER TABLE `d_b_code_sync_resource` DROP COLUMN `deleted`");
}
if (await columnExists(queryRunner, "d_b_code_sync_collection", "deleted")) {
await queryRunner.query("ALTER TABLE `d_b_code_sync_collection` DROP COLUMN `deleted`, ALGORITHM=INSTANT");
await queryRunner.query("ALTER TABLE `d_b_code_sync_collection` DROP COLUMN `deleted`");
}
}

public async down(queryRunner: QueryRunner): Promise<void> {
if (!(await columnExists(queryRunner, "d_b_code_sync_collection", "deleted"))) {
await queryRunner.query(
"ALTER TABLE `d_b_code_sync_collection` ADD COLUMN `deleted` tinyint(4) NOT NULL DEFAULT '0', ALGORITHM=INSTANT",
"ALTER TABLE `d_b_code_sync_collection` ADD COLUMN `deleted` tinyint(4) NOT NULL DEFAULT '0'",
);
}
if (!(await columnExists(queryRunner, "d_b_code_sync_resource", "deleted"))) {
await queryRunner.query(
"ALTER TABLE `d_b_code_sync_resource` ADD COLUMN `deleted` tinyint(4) NOT NULL DEFAULT '0', ALGORITHM=INSTANT",
"ALTER TABLE `d_b_code_sync_resource` ADD COLUMN `deleted` tinyint(4) NOT NULL DEFAULT '0'",
);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ 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");
await queryRunner.query("ALTER TABLE `d_b_cost_center` DROP COLUMN `deleted`");
}
}

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",
"ALTER TABLE `d_b_cost_center` ADD COLUMN `deleted` tinyint(4) NOT NULL DEFAULT '0'",
);
}
}
Expand Down

0 comments on commit d18ee26

Please sign in to comment.