Daniel O'Connell 9bee3a66f9 edit prices
2021-03-26 22:58:46 +01:00

18 lines
663 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"
"ALTER TABLE customer_group_products ADD price BIGINT"]
:down ["ALTER TABLE products DROP COLUMN price"
"ALTER TABLE order_products DROP COLUMN price"
"ALTER TABLE customer_group_products DROP COLUMN price"
"DROP TABLE customer_products"]}