Throw error if cannot find error in table

This commit is contained in:
fragosti
2019-02-20 11:40:49 -08:00
parent 12fd9c29f0
commit bc7e62db9f

View File

@@ -24,6 +24,8 @@ export class TokenOrderBookSnapshotsAddMakerAddress1550163069315 implements Migr
DROP CONSTRAINT "token_orderbook_snapshots_pkey1",
ADD PRIMARY KEY (observed_timestamp, source, order_type, price, base_asset_symbol, quote_asset_symbol, maker_address);
`);
} else {
throw new Error(`Could not find table with name ${TOKEN_ORDERBOOK_SNAPSHOT_TABLE}`);
}
}
@@ -31,6 +33,8 @@ export class TokenOrderBookSnapshotsAddMakerAddress1550163069315 implements Migr
const snapshotTable = await queryRunner.getTable(TOKEN_ORDERBOOK_SNAPSHOT_TABLE);
if (snapshotTable) {
await queryRunner.dropColumn(snapshotTable, NEW_COLUMN_NAME);
} else {
throw new Error(`Could not find table with name ${TOKEN_ORDERBOOK_SNAPSHOT_TABLE}`);
}
}
}