mirror of
https://github.com/mruwnik/chicken-master.git
synced 2025-06-08 21:34:43 +02:00
18 lines
663 B
Clojure
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"]}
|