Archive old migrations (#426)

* Archive old migrations

* Fix invalid placement of migrations
This commit is contained in:
Rikard Bartholf
2024-10-17 11:19:12 +02:00
committed by GitHub
parent 763262c108
commit ddcbd0afb0
500 changed files with 0 additions and 0 deletions
+20
View File
@@ -0,0 +1,20 @@
-- Store carts in database
DROP TABLE IF EXISTS cart_cookies, cart_users, cart_sessions;
CREATE TABLE cart_sessions (
id INTEGER GENERATED ALWAYS AS IDENTITY PRIMARY KEY,
market_locale_id INTEGER NOT NULL REFERENCES market_locales (id),
public_id TEXT NOT NULL,
active BOOLEAN NOT NULL DEFAULT TRUE,
content TEXT,
revision INTEGER NOT NULL DEFAULT 0,
inactive_reason TEXT,
created timestamp with time zone NOT NULL DEFAULT now(),
last_modified timestamp with time zone NOT NULL DEFAULT now()
);
CREATE UNIQUE INDEX ON cart_sessions (public_id);
-- last_modified reflects the last user interaction/modification of the cart.
-- It it not auto updated via trigger, to avoid having it update on non-user interactions, like us expiring the cart.
COMMENT ON COLUMN cart_sessions.last_modified IS 'Last update of cart contents';