From 1b82646c66f528ab18bd18bc9318cdf0b54f561b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20Elizondo?= Date: Wed, 2 Feb 2022 10:02:10 -0600 Subject: [PATCH 1/2] Moves migrations from orchestration. --- ...817555000-CreateDummyCompetitorsForCelo.ts | 28 +++++++++++++++++++ ...86000-CreateDummyCompetitorsForOptimism.ts | 28 +++++++++++++++++++ 2 files changed, 56 insertions(+) create mode 100644 event-pipeline-evm/migrations/celo/1643817555000-CreateDummyCompetitorsForCelo.ts create mode 100644 event-pipeline-evm/migrations/optimism/1643817586000-CreateDummyCompetitorsForOptimism.ts diff --git a/event-pipeline-evm/migrations/celo/1643817555000-CreateDummyCompetitorsForCelo.ts b/event-pipeline-evm/migrations/celo/1643817555000-CreateDummyCompetitorsForCelo.ts new file mode 100644 index 00000000..0d61f360 --- /dev/null +++ b/event-pipeline-evm/migrations/celo/1643817555000-CreateDummyCompetitorsForCelo.ts @@ -0,0 +1,28 @@ +import { MigrationInterface, QueryRunner } from 'typeorm'; + +export class CreateDummyCompetitorsForCelo1643817555000 implements MigrationInterface { + public async up(queryRunner: QueryRunner): Promise { + await queryRunner.query(` + CREATE TABLE events_celo.competitor_swaps ( + competitor text, + observed_timestamp int8, + contract_address varchar, + transaction_hash varchar, + transaction_index int8, + log_index int8, + block_hash varchar, + block_number int8, + from_token varchar, + to_token varchar, + from_token_amount numeric, + to_token_amount numeric, + "from" varchar, + "to" varchar + ); + `); + } + + public async down(queryRunner: QueryRunner): Promise { + await queryRunner.dropTable('events_celo.competitor_swaps'); + } +} diff --git a/event-pipeline-evm/migrations/optimism/1643817586000-CreateDummyCompetitorsForOptimism.ts b/event-pipeline-evm/migrations/optimism/1643817586000-CreateDummyCompetitorsForOptimism.ts new file mode 100644 index 00000000..fe9d8675 --- /dev/null +++ b/event-pipeline-evm/migrations/optimism/1643817586000-CreateDummyCompetitorsForOptimism.ts @@ -0,0 +1,28 @@ +import { MigrationInterface, QueryRunner } from 'typeorm'; + +export class CreateDummyCompetitorsForOptimism1643817586000 implements MigrationInterface { + public async up(queryRunner: QueryRunner): Promise { + await queryRunner.query(` + CREATE TABLE events_optimism.competitor_swaps ( + competitor text, + observed_timestamp int8, + contract_address varchar, + transaction_hash varchar, + transaction_index int8, + log_index int8, + block_hash varchar, + block_number int8, + from_token varchar, + to_token varchar, + from_token_amount numeric, + to_token_amount numeric, + "from" varchar, + "to" varchar + ); + `); + } + + public async down(queryRunner: QueryRunner): Promise { + await queryRunner.dropTable('events_optimism.competitor_swaps'); + } +} \ No newline at end of file From 0d4e7b43305caef7013295ad5fdfbfd7ba553086 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20Elizondo?= Date: Wed, 2 Feb 2022 10:14:19 -0600 Subject: [PATCH 2/2] Prettier --- .../optimism/1643817586000-CreateDummyCompetitorsForOptimism.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/event-pipeline-evm/migrations/optimism/1643817586000-CreateDummyCompetitorsForOptimism.ts b/event-pipeline-evm/migrations/optimism/1643817586000-CreateDummyCompetitorsForOptimism.ts index fe9d8675..de6857af 100644 --- a/event-pipeline-evm/migrations/optimism/1643817586000-CreateDummyCompetitorsForOptimism.ts +++ b/event-pipeline-evm/migrations/optimism/1643817586000-CreateDummyCompetitorsForOptimism.ts @@ -25,4 +25,4 @@ export class CreateDummyCompetitorsForOptimism1643817586000 implements Migration public async down(queryRunner: QueryRunner): Promise { await queryRunner.dropTable('events_optimism.competitor_swaps'); } -} \ No newline at end of file +}