Files
api/conf/evolutions/default/3.sql
T
2026-08-25 23:38:29 +03:00

17 lines
568 B
SQL

-- !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