diff options
Diffstat (limited to 'packages/pipeline/migrations/1542655823221-NewMetadataAndOHLCVTables.ts')
-rw-r--r-- | packages/pipeline/migrations/1542655823221-NewMetadataAndOHLCVTables.ts | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/packages/pipeline/migrations/1542655823221-NewMetadataAndOHLCVTables.ts b/packages/pipeline/migrations/1542655823221-NewMetadataAndOHLCVTables.ts index 5c7ec6de7..8d131271b 100644 --- a/packages/pipeline/migrations/1542655823221-NewMetadataAndOHLCVTables.ts +++ b/packages/pipeline/migrations/1542655823221-NewMetadataAndOHLCVTables.ts @@ -2,17 +2,23 @@ import {MigrationInterface, QueryRunner} from 'typeorm'; export class NewMetadataAndOHLCVTables1542655823221 implements MigrationInterface { + // tslint:disable-next-line public async up(queryRunner: QueryRunner): Promise<any> { await queryRunner.query(` - CREATE TABLE raw.trusted_tokens ( + CREATE TABLE raw.token_metadata ( address VARCHAR NOT NULL, authority VARCHAR NOT NULL, + decimals INT NULL, + symbol VARCHAR NULL, + name VARCHAR NULL, PRIMARY KEY (address, authority) ); `); + await queryRunner.dropTable('raw.token_on_chain_metadata'); + await queryRunner.query(` CREATE TABLE raw.ohlcv_external ( exchange VARCHAR NOT NULL, @@ -36,9 +42,21 @@ export class NewMetadataAndOHLCVTables1542655823221 implements MigrationInterfac `); } + // tslint:disable-next-line public async down(queryRunner: QueryRunner): Promise<any> { - await queryRunner.dropTable('raw.trusted_tokens'); + await queryRunner.query(` + CREATE TABLE raw.token_on_chain_metadata ( + address VARCHAR NOT NULL, + decimals INT NULL, + symbol VARCHAR NULL, + name VARCHAR NULL, + + PRIMARY KEY (address) + ); + `); + + await queryRunner.dropTable('raw.token_metadata'); await queryRunner.dropTable('raw.ohlcv_external'); } |