Skip to content

Commit

Permalink
Add MetaTxEvent to Optimism
Browse files Browse the repository at this point in the history
  • Loading branch information
Ktl-XV committed Jan 25, 2024
1 parent b0bfd14 commit df3ff13
Showing 1 changed file with 41 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import { MigrationInterface, QueryRunner, getConnection } from 'typeorm';

export class CreateMetaTransactionExecutedTable1677187153000 implements MigrationInterface {
public async up(queryRunner: QueryRunner): Promise<void> {
const connection = getConnection();
const { schema } = connection.options as any;
await queryRunner.query(
`create table ${schema}.meta_transaction_executed_events
(
observed_timestamp bigint not null,
contract_address varchar not null,
transaction_hash varchar not null,
transaction_index bigint not null,
log_index bigint not null,
block_hash varchar not null,
block_number bigint not null,
hash varchar not null,
selector varchar not null,
signer varchar not null,
sender varchar not null,
primary key (transaction_hash, log_index)
);
create index meta_transaction_executed_events_signer_index
on ${schema}.meta_transaction_executed_events (signer);
create index meta_transaction_executed_events_sender_index
on ${schema}.meta_transaction_executed_events (sender);
create index meta_transaction_executed_events_block_number_index
on ${schema}.meta_transaction_executed_events (block_number);
`,
);
}

public async down(queryRunner: QueryRunner): Promise<void> {
const connection = getConnection();
const { schema } = connection.options as any;
await queryRunner.query(`DROP TABLE ${schema}.meta_transaction_executed_events;`);
}
}

0 comments on commit df3ff13

Please sign in to comment.