* 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
27 lines
954 B
TypeScript
27 lines
954 B
TypeScript
import { BigNumber } from '@0x/utils';
|
|
import { Column, Entity, PrimaryColumn } from 'typeorm';
|
|
|
|
import { bigNumberTransformer, numberToBigIntTransformer } from '../utils';
|
|
|
|
@Entity({ name: 'erc20_approval_events', schema: 'raw' })
|
|
export class ERC20ApprovalEvent {
|
|
@PrimaryColumn({ name: 'token_address' })
|
|
public tokenAddress!: string;
|
|
@PrimaryColumn({ name: 'log_index' })
|
|
public logIndex!: number;
|
|
@PrimaryColumn({ name: 'block_number', transformer: numberToBigIntTransformer })
|
|
public blockNumber!: number;
|
|
|
|
@Column({ name: 'raw_data' })
|
|
public rawData!: string;
|
|
|
|
@PrimaryColumn({ name: 'transaction_hash' })
|
|
public transactionHash!: string;
|
|
@Column({ name: 'owner_address' })
|
|
public ownerAddress!: string;
|
|
@Column({ name: 'spender_address' })
|
|
public spenderAddress!: string;
|
|
@Column({ name: 'amount', type: 'numeric', transformer: bigNumberTransformer })
|
|
public amount!: BigNumber;
|
|
}
|