Skip to content

Commit

Permalink
fix: sync migrations with events entities (#112)
Browse files Browse the repository at this point in the history
  • Loading branch information
amateima authored Nov 22, 2024
1 parent d35c951 commit e0f8b8d
Showing 1 changed file with 89 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
import { MigrationInterface, QueryRunner } from "typeorm";

export class FinalisedEvents1732294733827 implements MigrationInterface {
name = "FinalisedEvents1732294733827";

public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
`ALTER TABLE "evm"."root_bundle_canceled" ALTER COLUMN "finalised" DROP DEFAULT`,
);
await queryRunner.query(
`ALTER TABLE "evm"."root_bundle_executed" ALTER COLUMN "finalised" DROP DEFAULT`,
);
await queryRunner.query(
`ALTER TABLE "evm"."root_bundle_disputed" ALTER COLUMN "finalised" DROP DEFAULT`,
);
await queryRunner.query(
`ALTER TABLE "evm"."proposed_root_bundle" ALTER COLUMN "chainIds" DROP DEFAULT`,
);
await queryRunner.query(
`ALTER TABLE "evm"."proposed_root_bundle" ALTER COLUMN "finalised" DROP DEFAULT`,
);
await queryRunner.query(
`ALTER TABLE "evm"."set_pool_rebalance_route" ALTER COLUMN "finalised" DROP DEFAULT`,
);
await queryRunner.query(
`ALTER TABLE "evm"."v3_funds_deposited" ALTER COLUMN "finalised" DROP DEFAULT`,
);
await queryRunner.query(
`ALTER TABLE "evm"."filled_v3_relay" ALTER COLUMN "finalised" DROP DEFAULT`,
);
await queryRunner.query(
`ALTER TABLE "evm"."requested_v3_slow_fill" ALTER COLUMN "finalised" DROP DEFAULT`,
);
await queryRunner.query(
`ALTER TABLE "evm"."requested_speed_up_v3_deposit" ALTER COLUMN "finalised" DROP DEFAULT`,
);
await queryRunner.query(
`ALTER TABLE "evm"."relayed_root_bundle" ALTER COLUMN "finalised" DROP DEFAULT`,
);
await queryRunner.query(
`ALTER TABLE "evm"."executed_relayer_refund_root" ALTER COLUMN "finalised" DROP DEFAULT`,
);
await queryRunner.query(
`ALTER TABLE "evm"."tokens_bridged" ALTER COLUMN "finalised" DROP DEFAULT`,
);
}

public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
`ALTER TABLE "evm"."tokens_bridged" ALTER COLUMN "finalised" SET DEFAULT true`,
);
await queryRunner.query(
`ALTER TABLE "evm"."executed_relayer_refund_root" ALTER COLUMN "finalised" SET DEFAULT true`,
);
await queryRunner.query(
`ALTER TABLE "evm"."relayed_root_bundle" ALTER COLUMN "finalised" SET DEFAULT true`,
);
await queryRunner.query(
`ALTER TABLE "evm"."requested_speed_up_v3_deposit" ALTER COLUMN "finalised" SET DEFAULT true`,
);
await queryRunner.query(
`ALTER TABLE "evm"."requested_v3_slow_fill" ALTER COLUMN "finalised" SET DEFAULT true`,
);
await queryRunner.query(
`ALTER TABLE "evm"."filled_v3_relay" ALTER COLUMN "finalised" SET DEFAULT true`,
);
await queryRunner.query(
`ALTER TABLE "evm"."v3_funds_deposited" ALTER COLUMN "finalised" SET DEFAULT true`,
);
await queryRunner.query(
`ALTER TABLE "evm"."set_pool_rebalance_route" ALTER COLUMN "finalised" SET DEFAULT true`,
);
await queryRunner.query(
`ALTER TABLE "evm"."proposed_root_bundle" ALTER COLUMN "finalised" SET DEFAULT true`,
);
await queryRunner.query(
`ALTER TABLE "evm"."proposed_root_bundle" ALTER COLUMN "chainIds" SET DEFAULT '[]'`,
);
await queryRunner.query(
`ALTER TABLE "evm"."root_bundle_disputed" ALTER COLUMN "finalised" SET DEFAULT true`,
);
await queryRunner.query(
`ALTER TABLE "evm"."root_bundle_executed" ALTER COLUMN "finalised" SET DEFAULT true`,
);
await queryRunner.query(
`ALTER TABLE "evm"."root_bundle_canceled" ALTER COLUMN "finalised" SET DEFAULT true`,
);
}
}

0 comments on commit e0f8b8d

Please sign in to comment.