event-scraper-v3/src/migration/1627606237070-CreatePerpLiq...

51 lines
1.1 KiB
TypeScript

import { MigrationInterface, QueryRunner, Table } from 'typeorm';
export class CreatePerpLiquidationEvent1627606237070 implements MigrationInterface {
async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.createTable(
new Table({
name: 'perp_liquidation_event',
columns: [
{
name: 'seqNum',
type: 'int8',
},
{
name: 'loadTimestamp',
type: 'timestamptz',
},
{
name: 'address',
type: 'text',
},
{
name: 'liqee',
type: 'text',
},
{
name: 'liqor',
type: 'text',
},
{
name: 'liquidationFee',
type: 'decimal',
},
{
name: 'price',
type: 'decimal',
},
{
name: 'quantity',
type: 'decimal',
},
],
}),
true
);
}
async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.dropTable('perp_liquidation_event');
}
}