mirror of
https://github.com/mruwnik/chicken-master.git
synced 2025-06-08 21:34:43 +02:00
11 lines
486 B
Clojure
11 lines
486 B
Clojure
{:up ["INSERT INTO recurrence_exceptions (order_id, order_date, status)
|
|
SELECT id AS order_id, order_date, status FROM orders
|
|
WHERE status = 'fulfilled'
|
|
ON conflict do nothing"
|
|
"ALTER TABLE orders DROP COLUMN status"]
|
|
:down ["ALTER TABLE orders ADD status order_state DEFAULT 'waiting'"
|
|
"UPDATE orders SET status = ex.status
|
|
FROM recurrence_exceptions AS ex
|
|
WHERE orders.id = ex.order_id AND orders.order_date = ex.order_date"]}
|
|
;
|