diff options
author | Leonid Logvinov <logvinov.leon@gmail.com> | 2019-01-10 18:51:13 +0800 |
---|---|---|
committer | Leonid Logvinov <logvinov.leon@gmail.com> | 2019-01-10 18:56:15 +0800 |
commit | cee29542451d3bf8c99bd08963a2108768072195 (patch) | |
tree | f3d657be53459ce3851fcf9632bd94f32ee80184 /packages/pipeline/src/entities/copper_activity.ts | |
parent | a8d9263062e586b90ee4c303d3d3aca72e428edc (diff) | |
parent | 686f27a96f0cd749f6315d7edd2bb56cf1819245 (diff) | |
download | dexon-0x-contracts-cee29542451d3bf8c99bd08963a2108768072195.tar.gz dexon-0x-contracts-cee29542451d3bf8c99bd08963a2108768072195.tar.zst dexon-0x-contracts-cee29542451d3bf8c99bd08963a2108768072195.zip |
Merge development
Diffstat (limited to 'packages/pipeline/src/entities/copper_activity.ts')
-rw-r--r-- | packages/pipeline/src/entities/copper_activity.ts | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/packages/pipeline/src/entities/copper_activity.ts b/packages/pipeline/src/entities/copper_activity.ts new file mode 100644 index 000000000..cbc034285 --- /dev/null +++ b/packages/pipeline/src/entities/copper_activity.ts @@ -0,0 +1,41 @@ +import { Column, Entity, Index, PrimaryColumn } from 'typeorm'; + +import { numberToBigIntTransformer } from '../utils'; + +@Entity({ name: 'copper_activities', schema: 'raw' }) +export class CopperActivity { + @PrimaryColumn({ type: 'bigint', transformer: numberToBigIntTransformer }) + public id!: number; + + @Index() + @Column({ name: 'parent_id', type: 'bigint', transformer: numberToBigIntTransformer }) + public parentId!: number; + @Column({ name: 'parent_type', type: 'varchar' }) + public parentType!: string; + + // join with CopperActivityType + @Index() + @Column({ name: 'type_id', type: 'bigint', transformer: numberToBigIntTransformer }) + public typeId!: number; + @Column({ name: 'type_category', type: 'varchar' }) + public typeCategory!: string; + @Column({ name: 'type_name', type: 'varchar', nullable: true }) + public typeName?: string; + + @Column({ name: 'user_id', type: 'bigint', transformer: numberToBigIntTransformer }) + public userId!: number; + @Column({ name: 'old_value_id', type: 'bigint', nullable: true, transformer: numberToBigIntTransformer }) + public oldValueId?: number; + @Column({ name: 'old_value_name', type: 'varchar', nullable: true }) + public oldValueName?: string; + @Column({ name: 'new_value_id', type: 'bigint', nullable: true, transformer: numberToBigIntTransformer }) + public newValueId?: number; + @Column({ name: 'new_value_name', type: 'varchar', nullable: true }) + public newValueName?: string; + + @Index() + @Column({ name: 'date_created', type: 'bigint', transformer: numberToBigIntTransformer }) + public dateCreated!: number; + @PrimaryColumn({ name: 'date_modified', type: 'bigint', transformer: numberToBigIntTransformer }) + public dateModified!: number; +} |