aboutsummaryrefslogtreecommitdiffstats
path: root/packages/pipeline/migrations/1544131658904-TokenOrderbookSnapshotAddOrderType.ts
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2018-12-19 00:59:15 +0800
committerFabio Berger <me@fabioberger.com>2018-12-19 00:59:15 +0800
commit622b9f662e74d571da745047ede097c7a392d09e (patch)
tree68a9517882b04a3d428f6996e0790ceb82e89be4 /packages/pipeline/migrations/1544131658904-TokenOrderbookSnapshotAddOrderType.ts
parente295eeb8938468b1527d5d81f212766cef40bc81 (diff)
parent67df5a433d68a2af1a3a03a8bf431629a534dc97 (diff)
downloaddexon-sol-tools-622b9f662e74d571da745047ede097c7a392d09e.tar
dexon-sol-tools-622b9f662e74d571da745047ede097c7a392d09e.tar.gz
dexon-sol-tools-622b9f662e74d571da745047ede097c7a392d09e.tar.bz2
dexon-sol-tools-622b9f662e74d571da745047ede097c7a392d09e.tar.lz
dexon-sol-tools-622b9f662e74d571da745047ede097c7a392d09e.tar.xz
dexon-sol-tools-622b9f662e74d571da745047ede097c7a392d09e.tar.zst
dexon-sol-tools-622b9f662e74d571da745047ede097c7a392d09e.zip
Merge branch 'development' into features/orderwatcher_ws
* development: (107 commits) Fix OrderWatcher title to fix sidebar top Fix version picker so it doesn't overflow onto two lines Fix bug in pull_missing_blocks with incorrect start block (#1438) Pull approval events for ZRX and DAI (#1430) fix semicolon and apply prettier Fix dex order quote/base asset assigning (#1432) Apply prettier Publish Updated CHANGELOGS Rename contracts CHANGELOGs to DEPLOYs Move Forwarder CHANGELOG entries to extensions CHANGELOG Make contracts packages not private Publish Updated CHANGELOGS Show @ price in light grey Updated CHANGELOGS typeof -> isString add special case to scrape OHLCV for eth/usd (#1428) run linter simplify scaling input logic ...
Diffstat (limited to 'packages/pipeline/migrations/1544131658904-TokenOrderbookSnapshotAddOrderType.ts')
-rw-r--r--packages/pipeline/migrations/1544131658904-TokenOrderbookSnapshotAddOrderType.ts33
1 files changed, 33 insertions, 0 deletions
diff --git a/packages/pipeline/migrations/1544131658904-TokenOrderbookSnapshotAddOrderType.ts b/packages/pipeline/migrations/1544131658904-TokenOrderbookSnapshotAddOrderType.ts
new file mode 100644
index 000000000..a501ec6d8
--- /dev/null
+++ b/packages/pipeline/migrations/1544131658904-TokenOrderbookSnapshotAddOrderType.ts
@@ -0,0 +1,33 @@
+import { MigrationInterface, QueryRunner } from 'typeorm';
+
+export class TokenOrderbookSnapshotAddOrderType1544131658904 implements MigrationInterface {
+ public async up(queryRunner: QueryRunner): Promise<any> {
+ await queryRunner.query(
+ `ALTER TABLE raw.token_orderbook_snapshots
+ DROP CONSTRAINT "PK_8a16487e7cb6862ec5a84ed3495",
+ ADD PRIMARY KEY (observed_timestamp, source, order_type, price, base_asset_symbol, quote_asset_symbol);
+ `,
+ );
+ await queryRunner.query(
+ `ALTER TABLE raw.token_orderbook_snapshots
+ ALTER COLUMN quote_asset_address DROP NOT NULL,
+ ALTER COLUMN base_asset_address DROP NOT NULL;
+ `,
+ );
+ }
+
+ public async down(queryRunner: QueryRunner): Promise<any> {
+ await queryRunner.query(
+ `ALTER TABLE raw.token_orderbook_snapshots
+ ALTER COLUMN quote_asset_address SET NOT NULL,
+ ALTER COLUMN base_asset_address SET NOT NULL;
+ `,
+ );
+ await queryRunner.query(
+ `ALTER TABLE raw.token_orderbook_snapshots
+ DROP CONSTRAINT token_orderbook_snapshots_pkey,
+ ADD CONSTRAINT "PK_8a16487e7cb6862ec5a84ed3495" PRIMARY KEY (observed_timestamp, source, price, base_asset_symbol, quote_asset_symbol);
+ `,
+ );
+ }
+}