From 629a8d632801c4861824b7d0423792d167b8564d Mon Sep 17 00:00:00 2001 From: "F. Eugene Aumson" Date: Fri, 8 Feb 2019 13:21:41 -0500 Subject: Add migration to fix exchange events primary keys (#1593) * Add migration to fix exchange events primary key * correct comment: "foreign key" -> "primary key" * Refine hack to handle only the expected error * Add tx hash to erc20 approval events primary key --- packages/pipeline/src/entities/erc20_approval_event.ts | 2 +- packages/pipeline/src/entities/exchange_cancel_event.ts | 2 +- packages/pipeline/src/entities/exchange_cancel_up_to_event.ts | 2 +- packages/pipeline/src/entities/exchange_fill_event.ts | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) (limited to 'packages/pipeline/src/entities') diff --git a/packages/pipeline/src/entities/erc20_approval_event.ts b/packages/pipeline/src/entities/erc20_approval_event.ts index 69cdfcb0b..ee5e621d2 100644 --- a/packages/pipeline/src/entities/erc20_approval_event.ts +++ b/packages/pipeline/src/entities/erc20_approval_event.ts @@ -15,7 +15,7 @@ export class ERC20ApprovalEvent { @Column({ name: 'raw_data' }) public rawData!: string; - @Column({ name: 'transaction_hash' }) + @PrimaryColumn({ name: 'transaction_hash' }) public transactionHash!: string; @Column({ name: 'owner_address' }) public ownerAddress!: string; diff --git a/packages/pipeline/src/entities/exchange_cancel_event.ts b/packages/pipeline/src/entities/exchange_cancel_event.ts index 38f99c903..a86194920 100644 --- a/packages/pipeline/src/entities/exchange_cancel_event.ts +++ b/packages/pipeline/src/entities/exchange_cancel_event.ts @@ -15,7 +15,7 @@ export class ExchangeCancelEvent { @Column({ name: 'raw_data' }) public rawData!: string; - @Column({ name: 'transaction_hash' }) + @PrimaryColumn({ name: 'transaction_hash' }) public transactionHash!: string; @Column({ name: 'maker_address' }) public makerAddress!: string; diff --git a/packages/pipeline/src/entities/exchange_cancel_up_to_event.ts b/packages/pipeline/src/entities/exchange_cancel_up_to_event.ts index 27580305e..f24aea23a 100644 --- a/packages/pipeline/src/entities/exchange_cancel_up_to_event.ts +++ b/packages/pipeline/src/entities/exchange_cancel_up_to_event.ts @@ -15,7 +15,7 @@ export class ExchangeCancelUpToEvent { @Column({ name: 'raw_data' }) public rawData!: string; - @Column({ name: 'transaction_hash' }) + @PrimaryColumn({ name: 'transaction_hash' }) public transactionHash!: string; @Column({ name: 'maker_address' }) public makerAddress!: string; diff --git a/packages/pipeline/src/entities/exchange_fill_event.ts b/packages/pipeline/src/entities/exchange_fill_event.ts index 9b7727615..52111711e 100644 --- a/packages/pipeline/src/entities/exchange_fill_event.ts +++ b/packages/pipeline/src/entities/exchange_fill_event.ts @@ -16,7 +16,7 @@ export class ExchangeFillEvent { @Column({ name: 'raw_data' }) public rawData!: string; - @Column({ name: 'transaction_hash' }) + @PrimaryColumn({ name: 'transaction_hash' }) public transactionHash!: string; @Column({ name: 'maker_address' }) public makerAddress!: string; -- cgit v1.2.3