aboutsummaryrefslogtreecommitdiffstats
path: root/packages/pipeline/migrations
diff options
context:
space:
mode:
authorJake Ellowitz <jake.ellowitz@gmail.com>2018-11-20 11:11:51 +0800
committerAlex Browne <stephenalexbrowne@gmail.com>2018-12-05 06:24:48 +0800
commitdea89c4e221d5b22de97b27573719cd27ce250c7 (patch)
tree8bb98513d90e6759d57f20d2d458625d4b68dc80 /packages/pipeline/migrations
parentc6af5131b0b06433d6294260274e187ad61f4ef7 (diff)
downloaddexon-sol-tools-dea89c4e221d5b22de97b27573719cd27ce250c7.tar
dexon-sol-tools-dea89c4e221d5b22de97b27573719cd27ce250c7.tar.gz
dexon-sol-tools-dea89c4e221d5b22de97b27573719cd27ce250c7.tar.bz2
dexon-sol-tools-dea89c4e221d5b22de97b27573719cd27ce250c7.tar.lz
dexon-sol-tools-dea89c4e221d5b22de97b27573719cd27ce250c7.tar.xz
dexon-sol-tools-dea89c4e221d5b22de97b27573719cd27ce250c7.tar.zst
dexon-sol-tools-dea89c4e221d5b22de97b27573719cd27ce250c7.zip
metadata and trusted sources in same raw table
Diffstat (limited to 'packages/pipeline/migrations')
-rw-r--r--packages/pipeline/migrations/1542655823221-NewMetadataAndOHLCVTables.ts22
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');
}