0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-24 23:49:45 -05:00
penpot/backend/resources/migrations/0005.kvstore.up.sql
Andrey Antukh e9b00339a5 🚧 Major refactor of backend code.
Relevant changes:

- ring -> vertx
- suricatta -> vertx-pgsql
- emails improvements
- logging
- hybrid sync/async -> full async execution model
- database layout refactor
2019-11-18 12:35:41 +01:00

14 lines
424 B
SQL

CREATE TABLE IF NOT EXISTS kvstore (
user_id uuid NOT NULL REFERENCES users(id) ON DELETE CASCADE,
created_at timestamptz NOT NULL DEFAULT clock_timestamp(),
modified_at timestamptz NOT NULL DEFAULT clock_timestamp(),
key text NOT NULL,
value bytea NOT NULL,
PRIMARY KEY (key, user_id)
);
CREATE TRIGGER kvstore_modified_at_tgr BEFORE UPDATE ON kvstore
FOR EACH ROW EXECUTE PROCEDURE update_modified_at();