aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfragosti <francesco.agosti93@gmail.com>2019-02-02 07:50:04 +0800
committerfragosti <francesco.agosti93@gmail.com>2019-02-02 07:50:04 +0800
commit4f3cab42131f0bbe5e3f08cc04a1d7f60c6d48a0 (patch)
tree692cedd6e22a6b75118a77557ad3b65816e26f81
parent4996ae8d9d90c138776d6660965289ae7aba18de (diff)
downloaddexon-0x-contracts-4f3cab42131f0bbe5e3f08cc04a1d7f60c6d48a0.tar
dexon-0x-contracts-4f3cab42131f0bbe5e3f08cc04a1d7f60c6d48a0.tar.gz
dexon-0x-contracts-4f3cab42131f0bbe5e3f08cc04a1d7f60c6d48a0.tar.bz2
dexon-0x-contracts-4f3cab42131f0bbe5e3f08cc04a1d7f60c6d48a0.tar.lz
dexon-0x-contracts-4f3cab42131f0bbe5e3f08cc04a1d7f60c6d48a0.tar.xz
dexon-0x-contracts-4f3cab42131f0bbe5e3f08cc04a1d7f60c6d48a0.tar.zst
dexon-0x-contracts-4f3cab42131f0bbe5e3f08cc04a1d7f60c6d48a0.zip
add row deletion step to migration
-rw-r--r--packages/pipeline/migrations/1548809952793-AllowDuplicateTxHashesInDexTrades.ts4
1 files changed, 3 insertions, 1 deletions
diff --git a/packages/pipeline/migrations/1548809952793-AllowDuplicateTxHashesInDexTrades.ts b/packages/pipeline/migrations/1548809952793-AllowDuplicateTxHashesInDexTrades.ts
index 1b396918e..21b08f0ef 100644
--- a/packages/pipeline/migrations/1548809952793-AllowDuplicateTxHashesInDexTrades.ts
+++ b/packages/pipeline/migrations/1548809952793-AllowDuplicateTxHashesInDexTrades.ts
@@ -6,7 +6,9 @@ export class AllowDuplicateTxHashesInDexTrades1548809952793 implements Migration
public async up(queryRunner: QueryRunner): Promise<any> {
const dexTradesTable = await queryRunner.getTable(DEX_TRADES_TABLE_NAME);
if (dexTradesTable) {
- // Composite key goes from (source_url, tx_hash) to (trade_index, source_url, tx_hash)
+ // Need new primary key to be non-null. No default value makes sense, so drop table.
+ await queryRunner.query(`DELETE from ${DEX_TRADES_TABLE_NAME}`);
+ // Composite key goes from (source_url, tx_hash) to (source_url, tx_hash, trade_index)
await queryRunner.addColumn(
DEX_TRADES_TABLE_NAME,
new TableColumn({