aboutsummaryrefslogtreecommitdiffstats
path: root/packages/pipeline/migrations/1543983324954-ConvertTransactionGasPriceToBigNumber.ts
blob: dcb0fd72708ab675665d5052929c6b68c82d6b71 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import { MigrationInterface, QueryRunner } from 'typeorm';

export class ConvertTransactionGasPriceToBigNumber1543983324954 implements MigrationInterface {
    public async up(queryRunner: QueryRunner): Promise<any> {
        await queryRunner.query(
            `ALTER TABLE raw.transactions
                ALTER COLUMN gas_price TYPE numeric USING gas_price::numeric,
                ALTER COLUMN gas_used TYPE numeric USING gas_used::numeric;`,
        );
    }

    public async down(queryRunner: QueryRunner): Promise<any> {
        await queryRunner.query(
            `ALTER TABLE raw.transactions
                ALTER COLUMN gas_price TYPE numeric USING gas_price::bigint,
                ALTER COLUMN gas_used TYPE numeric USING gas_used::bigint;`,
        );
    }
}