code.vegaprotocol.io/vega@v0.79.0/datanode/sqlstore/migrations/0118_add_fees_to_positions.sql (about)

     1  -- +goose Up
     2  
     3  ALTER TABLE positions ADD COLUMN IF NOT EXISTS taker_fees_paid HUGEINT NOT NULL DEFAULT (0);
     4  ALTER TABLE positions ADD COLUMN IF NOT EXISTS maker_fees_received HUGEINT NOT NULL DEFAULT (0);
     5  ALTER TABLE positions ADD COLUMN IF NOT EXISTS fees_paid HUGEINT NOT NULL DEFAULT (0);
     6  ALTER TABLE positions ADD COLUMN IF NOT EXISTS taker_fees_paid_since HUGEINT NOT NULL DEFAULT (0);
     7  ALTER TABLE positions ADD COLUMN IF NOT EXISTS maker_fees_received_since HUGEINT NOT NULL DEFAULT (0);
     8  ALTER TABLE positions ADD COLUMN IF NOT EXISTS fees_paid_since HUGEINT NOT NULL DEFAULT (0);
     9  ALTER TABLE positions ADD COLUMN IF NOT EXISTS funding_payment_amount HUGEINT NOT NULL DEFAULT(0);
    10  ALTER TABLE positions ADD COLUMN IF NOT EXISTS funding_payment_amount_since HUGEINT NOT NULL DEFAULT(0);
    11  
    12  -- +goose Down
    13  
    14  ALTER TABLE positions DROP COLUMN IF EXISTS taker_fees_paid;
    15  ALTER TABLE positions DROP COLUMN IF EXISTS maker_fees_received;
    16  ALTER TABLE positions DROP COLUMN IF EXISTS fees_paid;
    17  ALTER TABLE positions DROP COLUMN IF EXISTS taker_fees_paid_since;
    18  ALTER TABLE positions DROP COLUMN IF EXISTS maker_fees_received_since;
    19  ALTER TABLE positions DROP COLUMN IF EXISTS fees_paid_since;
    20  ALTER TABLE positions DROP COLUMN IF EXISTS funding_payment_amount;
    21  ALTER TABLE positions DROP COLUMN IF EXISTS funding_payment_amount_since;