diff options
author | Alex Browne <stephenalexbrowne@gmail.com> | 2018-11-30 03:40:09 +0800 |
---|---|---|
committer | Alex Browne <stephenalexbrowne@gmail.com> | 2018-12-05 06:25:42 +0800 |
commit | 7198b441e0d85785eec7244dd60bcd92269d954e (patch) | |
tree | b1169b274f113fb92e1d748a97eea631c2f77420 /packages/pipeline/migrations | |
parent | 3d211c415b58a67f84332ff512bf9372cac5a3ac (diff) | |
download | dexon-sol-tools-7198b441e0d85785eec7244dd60bcd92269d954e.tar dexon-sol-tools-7198b441e0d85785eec7244dd60bcd92269d954e.tar.gz dexon-sol-tools-7198b441e0d85785eec7244dd60bcd92269d954e.tar.bz2 dexon-sol-tools-7198b441e0d85785eec7244dd60bcd92269d954e.tar.lz dexon-sol-tools-7198b441e0d85785eec7244dd60bcd92269d954e.tar.xz dexon-sol-tools-7198b441e0d85785eec7244dd60bcd92269d954e.tar.zst dexon-sol-tools-7198b441e0d85785eec7244dd60bcd92269d954e.zip |
Add script for parsing competing dex trades from Bloxy (#1355)
Diffstat (limited to 'packages/pipeline/migrations')
-rw-r--r-- | packages/pipeline/migrations/1543446690436-CreateDexTrades.ts | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/packages/pipeline/migrations/1543446690436-CreateDexTrades.ts b/packages/pipeline/migrations/1543446690436-CreateDexTrades.ts new file mode 100644 index 000000000..267cf144b --- /dev/null +++ b/packages/pipeline/migrations/1543446690436-CreateDexTrades.ts @@ -0,0 +1,41 @@ +import { MigrationInterface, QueryRunner, Table } from 'typeorm'; + +const dexTrades = new Table({ + name: 'raw.dex_trades', + columns: [ + { name: 'source_url', type: 'varchar', isPrimary: true }, + { name: 'tx_hash', type: 'varchar', isPrimary: true }, + + { name: 'tx_timestamp', type: 'bigint' }, + { name: 'tx_date', type: 'varchar' }, + { name: 'tx_sender', type: 'varchar(42)' }, + { name: 'smart_contract_id', type: 'bigint' }, + { name: 'smart_contract_address', type: 'varchar(42)' }, + { name: 'contract_type', type: 'varchar' }, + { name: 'maker', type: 'varchar(42)' }, + { name: 'taker', type: 'varchar(42)' }, + { name: 'amount_buy', type: 'numeric' }, + { name: 'maker_fee_amount', type: 'numeric' }, + { name: 'buy_currency_id', type: 'bigint' }, + { name: 'buy_symbol', type: 'varchar' }, + { name: 'amount_sell', type: 'numeric' }, + { name: 'taker_fee_amount', type: 'numeric' }, + { name: 'sell_currency_id', type: 'bigint' }, + { name: 'sell_symbol', type: 'varchar' }, + { name: 'maker_annotation', type: 'varchar' }, + { name: 'taker_annotation', type: 'varchar' }, + { name: 'protocol', type: 'varchar' }, + { name: 'buy_address', type: 'varchar(42)', isNullable: true }, + { name: 'sell_address', type: 'varchar(42)', isNullable: true }, + ], +}); + +export class CreateDexTrades1543446690436 implements MigrationInterface { + public async up(queryRunner: QueryRunner): Promise<any> { + await queryRunner.createTable(dexTrades); + } + + public async down(queryRunner: QueryRunner): Promise<any> { + await queryRunner.dropTable(dexTrades); + } +} |