Daniel O'Connell c46a505b4c products prices
2021-03-17 23:06:28 +01:00

16 lines
538 B
Clojure

{:up ["CREATE TABLE customer_products (
id SERIAL,
customer_id INT,
product_id INT,
amount NUMERIC,
price BIGINT,
PRIMARY KEY(id),
CONSTRAINT fk_customer FOREIGN KEY(customer_id) REFERENCES customers(id),
CONSTRAINT fk_product FOREIGN KEY(product_id) REFERENCES products(id)
)"
"ALTER TABLE products ADD price BIGINT"
"ALTER TABLE order_products ADD price BIGINT"]
:down ["ALTER TABLE products DROP COLUMN price"
"ALTER TABLE order_products DROP COLUMN price"
"DROP TABLE customer_products"]}