-- !Ups
CREATE TABLE auctions
(
    id                BIGINT PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY,
    name              VARCHAR                      NOT NULL,
    gid               VARCHAR UNIQUE               NOT NULL,
    author_id         BIGINT REFERENCES users (id) NOT NULL,
    starting_price    DECIMAL(20, 3)               NOT NULL,
    current_bid       DECIMAL(20, 3),
    current_bidder_id BIGINT REFERENCES users (id),
    current_bid_at    TIMESTAMP,
    created_at        TIMESTAMP                    NOT NULL
);

-- !Downs

DROP TABLE auctions