Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CREATE TABLE IF NOT EXISTS orders
- (
- id BIGSERIAL PRIMARY KEY,
- user_id BIGINT REFERENCES users (id) NOT NULL,
- created_at DATE NOT NULL
- );
- CREATE TABLE IF NOT EXISTS order_entries
- (
- product_id BIGINT REFERENCES products (id) NOT NULL,
- order_id BIGINT REFERENCES orders (id) NOT NULL,
- product_quantity BIGINT NOT NULL,
- price NUMERIC(15, 2) NOT NULL,
- total NUMERIC(15, 2) NOT NULL
- );
- CREATE TABLE IF NOT EXISTS carts
- (
- id BIGSERIAL PRIMARY KEY,
- product_id BIGINT REFERENCES products (id) NOT NULL,
- product_quantity BIGINT NOT NULL,
- user_id BIGINT REFERENCES users (id) NOT NULL
- );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement