-- !Ups
CREATE TABLE auctions
(
    id                BIGINT PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY,
    gid               VARCHAR UNIQUE NOT NULL,
    author_id         BIGINT         NOT NULL REFERENCES users (id) ON DELETE RESTRICT,
    description       VARCHAR,
    starting_price    DECIMAL(12, 3) NOT NULL,
    current_bid       DECIMAL(12, 3),
    current_bidder_id BIGINT         REFERENCES users (id) ON DELETE SET NULL
);

-- !Downs
DROP TABLE auctions;