-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Tag Block/Tx backfills as done instead of removing them
- Loading branch information
Showing
11 changed files
with
194 additions
and
4 deletions.
There are no files selected for viewing
20 changes: 20 additions & 0 deletions
20
migrations/arbitrum/1706550739000-AddDoneToTxBackfillTable.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,20 @@ | ||
import { MigrationInterface, QueryRunner, getConnection } from 'typeorm'; | ||
|
||
export class AddDoneToTxBackfillTable1706550739000 implements MigrationInterface { | ||
public async up(queryRunner: QueryRunner): Promise<void> { | ||
const connection = getConnection(); | ||
const { schema } = connection.options as any; | ||
await queryRunner.query(` | ||
ALTER TABLE ${schema}.tx_backfill ADD CONSTRAINT tx_backfill_pk PRIMARY KEY (transaction_hash, block_number); | ||
ALTER TABLE ${schema}.tx_backfill ADD done boolean NOT NULL DEFAULT FALSE; | ||
CREATE INDEX tx_backfill_partial ON ${schema}.tx_backfill (transaction_hash, block_number) | ||
WHERE done = FALSE; | ||
`); | ||
} | ||
|
||
public async down(queryRunner: QueryRunner): Promise<void> { | ||
const connection = getConnection(); | ||
const { schema } = connection.options as any; | ||
await queryRunner.query(`ALTER TABLE ${schema}.tx_backfill UPDATE DROP COLUMN done;`); | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
migrations/avalanche/1706550739000-AddDoneToTxBackfillTable.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,20 @@ | ||
import { MigrationInterface, QueryRunner, getConnection } from 'typeorm'; | ||
|
||
export class AddDoneToTxBackfillTable1706550739000 implements MigrationInterface { | ||
public async up(queryRunner: QueryRunner): Promise<void> { | ||
const connection = getConnection(); | ||
const { schema } = connection.options as any; | ||
await queryRunner.query(` | ||
ALTER TABLE ${schema}.tx_backfill ADD CONSTRAINT tx_backfill_pk PRIMARY KEY (transaction_hash, block_number); | ||
ALTER TABLE ${schema}.tx_backfill ADD done boolean NOT NULL DEFAULT FALSE; | ||
CREATE INDEX tx_backfill_partial ON ${schema}.tx_backfill (transaction_hash, block_number) | ||
WHERE done = FALSE; | ||
`); | ||
} | ||
|
||
public async down(queryRunner: QueryRunner): Promise<void> { | ||
const connection = getConnection(); | ||
const { schema } = connection.options as any; | ||
await queryRunner.query(`ALTER TABLE ${schema}.tx_backfill UPDATE DROP COLUMN done;`); | ||
} | ||
} |
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,20 @@ | ||
import { MigrationInterface, QueryRunner, getConnection } from 'typeorm'; | ||
|
||
export class AddDoneToTxBackfillTable1706550739000 implements MigrationInterface { | ||
public async up(queryRunner: QueryRunner): Promise<void> { | ||
const connection = getConnection(); | ||
const { schema } = connection.options as any; | ||
await queryRunner.query(` | ||
ALTER TABLE ${schema}.tx_backfill ADD CONSTRAINT tx_backfill_pk PRIMARY KEY (transaction_hash, block_number); | ||
ALTER TABLE ${schema}.tx_backfill ADD done boolean NOT NULL DEFAULT FALSE; | ||
CREATE INDEX tx_backfill_partial ON ${schema}.tx_backfill (transaction_hash, block_number) | ||
WHERE done = FALSE; | ||
`); | ||
} | ||
|
||
public async down(queryRunner: QueryRunner): Promise<void> { | ||
const connection = getConnection(); | ||
const { schema } = connection.options as any; | ||
await queryRunner.query(`ALTER TABLE ${schema}.tx_backfill UPDATE DROP COLUMN done;`); | ||
} | ||
} |
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,20 @@ | ||
import { MigrationInterface, QueryRunner, getConnection } from 'typeorm'; | ||
|
||
export class AddDoneToTxBackfillTable1706550739000 implements MigrationInterface { | ||
public async up(queryRunner: QueryRunner): Promise<void> { | ||
const connection = getConnection(); | ||
const { schema } = connection.options as any; | ||
await queryRunner.query(` | ||
ALTER TABLE ${schema}.tx_backfill ADD CONSTRAINT tx_backfill_pk PRIMARY KEY (transaction_hash, block_number); | ||
ALTER TABLE ${schema}.tx_backfill ADD done boolean NOT NULL DEFAULT FALSE; | ||
CREATE INDEX tx_backfill_partial ON ${schema}.tx_backfill (transaction_hash, block_number) | ||
WHERE done = FALSE; | ||
`); | ||
} | ||
|
||
public async down(queryRunner: QueryRunner): Promise<void> { | ||
const connection = getConnection(); | ||
const { schema } = connection.options as any; | ||
await queryRunner.query(`ALTER TABLE ${schema}.tx_backfill UPDATE DROP COLUMN done;`); | ||
} | ||
} |
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,20 @@ | ||
import { MigrationInterface, QueryRunner, getConnection } from 'typeorm'; | ||
|
||
export class AddDoneToTxBackfillTable1706550739000 implements MigrationInterface { | ||
public async up(queryRunner: QueryRunner): Promise<void> { | ||
const connection = getConnection(); | ||
const { schema } = connection.options as any; | ||
await queryRunner.query(` | ||
ALTER TABLE ${schema}.tx_backfill ADD CONSTRAINT tx_backfill_pk PRIMARY KEY (transaction_hash, block_number); | ||
ALTER TABLE ${schema}.tx_backfill ADD done boolean NOT NULL DEFAULT FALSE; | ||
CREATE INDEX tx_backfill_partial ON ${schema}.tx_backfill (transaction_hash, block_number) | ||
WHERE done = FALSE; | ||
`); | ||
} | ||
|
||
public async down(queryRunner: QueryRunner): Promise<void> { | ||
const connection = getConnection(); | ||
const { schema } = connection.options as any; | ||
await queryRunner.query(`ALTER TABLE ${schema}.tx_backfill UPDATE DROP COLUMN done;`); | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
migrations/ethereum/1706550739000-AddDoneToTxBackfillTable.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,20 @@ | ||
import { MigrationInterface, QueryRunner, getConnection } from 'typeorm'; | ||
|
||
export class AddDoneToTxBackfillTable1706550739000 implements MigrationInterface { | ||
public async up(queryRunner: QueryRunner): Promise<void> { | ||
const connection = getConnection(); | ||
const { schema } = connection.options as any; | ||
await queryRunner.query(` | ||
ALTER TABLE ${schema}.tx_backfill ADD CONSTRAINT tx_backfill_pk PRIMARY KEY (transaction_hash, block_number); | ||
ALTER TABLE ${schema}.tx_backfill ADD done boolean NOT NULL DEFAULT FALSE; | ||
CREATE INDEX tx_backfill_partial ON ${schema}.tx_backfill (transaction_hash, block_number) | ||
WHERE done = FALSE; | ||
`); | ||
} | ||
|
||
public async down(queryRunner: QueryRunner): Promise<void> { | ||
const connection = getConnection(); | ||
const { schema } = connection.options as any; | ||
await queryRunner.query(`ALTER TABLE ${schema}.tx_backfill UPDATE DROP COLUMN done;`); | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
migrations/fantom/1706550739000-AddDoneToTxBackfillTable.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,20 @@ | ||
import { MigrationInterface, QueryRunner, getConnection } from 'typeorm'; | ||
|
||
export class AddDoneToTxBackfillTable1706550739000 implements MigrationInterface { | ||
public async up(queryRunner: QueryRunner): Promise<void> { | ||
const connection = getConnection(); | ||
const { schema } = connection.options as any; | ||
await queryRunner.query(` | ||
ALTER TABLE ${schema}.tx_backfill ADD CONSTRAINT tx_backfill_pk PRIMARY KEY (transaction_hash, block_number); | ||
ALTER TABLE ${schema}.tx_backfill ADD done boolean NOT NULL DEFAULT FALSE; | ||
CREATE INDEX tx_backfill_partial ON ${schema}.tx_backfill (transaction_hash, block_number) | ||
WHERE done = FALSE; | ||
`); | ||
} | ||
|
||
public async down(queryRunner: QueryRunner): Promise<void> { | ||
const connection = getConnection(); | ||
const { schema } = connection.options as any; | ||
await queryRunner.query(`ALTER TABLE ${schema}.tx_backfill UPDATE DROP COLUMN done;`); | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
migrations/optimism/1706550739000-AddDoneToTxBackfillTable.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,20 @@ | ||
import { MigrationInterface, QueryRunner, getConnection } from 'typeorm'; | ||
|
||
export class AddDoneToTxBackfillTable1706550739000 implements MigrationInterface { | ||
public async up(queryRunner: QueryRunner): Promise<void> { | ||
const connection = getConnection(); | ||
const { schema } = connection.options as any; | ||
await queryRunner.query(` | ||
ALTER TABLE ${schema}.tx_backfill ADD CONSTRAINT tx_backfill_pk PRIMARY KEY (transaction_hash, block_number); | ||
ALTER TABLE ${schema}.tx_backfill ADD done boolean NOT NULL DEFAULT FALSE; | ||
CREATE INDEX tx_backfill_partial ON ${schema}.tx_backfill (transaction_hash, block_number) | ||
WHERE done = FALSE; | ||
`); | ||
} | ||
|
||
public async down(queryRunner: QueryRunner): Promise<void> { | ||
const connection = getConnection(); | ||
const { schema } = connection.options as any; | ||
await queryRunner.query(`ALTER TABLE ${schema}.tx_backfill UPDATE DROP COLUMN done;`); | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
migrations/polygon/1706550739000-AddDoneToTxBackfillTable.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,20 @@ | ||
import { MigrationInterface, QueryRunner, getConnection } from 'typeorm'; | ||
|
||
export class AddDoneToTxBackfillTable1706550739000 implements MigrationInterface { | ||
public async up(queryRunner: QueryRunner): Promise<void> { | ||
const connection = getConnection(); | ||
const { schema } = connection.options as any; | ||
await queryRunner.query(` | ||
ALTER TABLE ${schema}.tx_backfill ADD CONSTRAINT tx_backfill_pk PRIMARY KEY (transaction_hash, block_number); | ||
ALTER TABLE ${schema}.tx_backfill ADD done boolean NOT NULL DEFAULT FALSE; | ||
CREATE INDEX tx_backfill_partial ON ${schema}.tx_backfill (transaction_hash, block_number) | ||
WHERE done = FALSE; | ||
`); | ||
} | ||
|
||
public async down(queryRunner: QueryRunner): Promise<void> { | ||
const connection = getConnection(); | ||
const { schema } = connection.options as any; | ||
await queryRunner.query(`ALTER TABLE ${schema}.tx_backfill UPDATE DROP COLUMN done;`); | ||
} | ||
} |
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
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