aboutsummaryrefslogtreecommitdiffstats
path: root/packages/pipeline/migrations/1542147915364-NewSraOrderTimestampFormat.ts
diff options
context:
space:
mode:
authorHsuan Lee <boczeratul@gmail.com>2019-03-06 17:46:50 +0800
committerHsuan Lee <boczeratul@gmail.com>2019-03-06 17:46:50 +0800
commit35703539d0f2b4ddb3b11d0de8c9634af59ab71f (patch)
treeae3731221dbbb3a6fa40060a8d916cfd3f738289 /packages/pipeline/migrations/1542147915364-NewSraOrderTimestampFormat.ts
parent92a1fde5b1ecd81b07cdb5bf0c9c1cd3544799db (diff)
downloaddexon-0x-contracts-35703539d0f2b4ddb3b11d0de8c9634af59ab71f.tar
dexon-0x-contracts-35703539d0f2b4ddb3b11d0de8c9634af59ab71f.tar.gz
dexon-0x-contracts-35703539d0f2b4ddb3b11d0de8c9634af59ab71f.tar.bz2
dexon-0x-contracts-35703539d0f2b4ddb3b11d0de8c9634af59ab71f.tar.lz
dexon-0x-contracts-35703539d0f2b4ddb3b11d0de8c9634af59ab71f.tar.xz
dexon-0x-contracts-35703539d0f2b4ddb3b11d0de8c9634af59ab71f.tar.zst
dexon-0x-contracts-35703539d0f2b4ddb3b11d0de8c9634af59ab71f.zip
Deploy @dexon-foundation/0x.jsstable
Diffstat (limited to 'packages/pipeline/migrations/1542147915364-NewSraOrderTimestampFormat.ts')
-rw-r--r--packages/pipeline/migrations/1542147915364-NewSraOrderTimestampFormat.ts48
1 files changed, 0 insertions, 48 deletions
diff --git a/packages/pipeline/migrations/1542147915364-NewSraOrderTimestampFormat.ts b/packages/pipeline/migrations/1542147915364-NewSraOrderTimestampFormat.ts
deleted file mode 100644
index 5a8f3fec8..000000000
--- a/packages/pipeline/migrations/1542147915364-NewSraOrderTimestampFormat.ts
+++ /dev/null
@@ -1,48 +0,0 @@
-import { MigrationInterface, QueryRunner, Table } from 'typeorm';
-
-export class NewSraOrderTimestampFormat1542147915364 implements MigrationInterface {
- public async up(queryRunner: QueryRunner): Promise<any> {
- await queryRunner.query(
- `ALTER TABLE raw.sra_orders
- DROP CONSTRAINT "PK_09bfb9980715329563bd53d667e",
- ADD PRIMARY KEY (order_hash_hex, exchange_address, source_url);
- `,
- );
-
- await queryRunner.query(
- `CREATE TABLE raw.sra_orders_observed_timestamps (
- order_hash_hex varchar NOT NULL,
- exchange_address varchar NOT NULL,
- source_url varchar NOT NULL,
- observed_timestamp bigint NOT NULL,
- FOREIGN KEY
- (order_hash_hex, exchange_address, source_url)
- REFERENCES raw.sra_orders (order_hash_hex, exchange_address, source_url),
- PRIMARY KEY (order_hash_hex, exchange_address, source_url, observed_timestamp)
- );`,
- );
-
- await queryRunner.query(
- `ALTER TABLE raw.sra_orders
- DROP COLUMN last_updated_timestamp,
- DROP COLUMN first_seen_timestamp;`,
- );
- }
-
- public async down(queryRunner: QueryRunner): Promise<any> {
- await queryRunner.dropTable('raw.sra_orders_observed_timestamps');
-
- await queryRunner.query(
- `ALTER TABLE raw.sra_orders
- ADD COLUMN last_updated_timestamp bigint NOT NULL DEFAULT 0,
- ADD COLUMN first_seen_timestamp bigint NOT NULL DEFAULT 0;`,
- );
-
- await queryRunner.query(
- `ALTER TABLE raw.sra_orders
- DROP CONSTRAINT sra_orders_pkey,
- ADD CONSTRAINT "PK_09bfb9980715329563bd53d667e" PRIMARY KEY ("exchange_address", "order_hash_hex");
- `,
- );
- }
-}