-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: sync migrations with events entities (#112)
- Loading branch information
Showing
1 changed file
with
89 additions
and
0 deletions.
There are no files selected for viewing
89 changes: 89 additions & 0 deletions
89
packages/indexer-database/src/migrations/1732294733827-FinalisedEvents.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,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`, | ||
); | ||
} | ||
} |