aboutsummaryrefslogtreecommitdiffstats
path: root/migrations/20260329120645_transaction_schema.sql
diff options
context:
space:
mode:
authorrtkay123 <dev@kanjala.com>2026-03-29 15:06:30 +0200
committerrtkay123 <dev@kanjala.com>2026-03-29 15:06:30 +0200
commit7e08464b2a42048ebb5128bec5731719cf8bd1db (patch)
treea3b2da94cfcd6ceff480e30a37692b48ca85144f /migrations/20260329120645_transaction_schema.sql
parenta32f67624b14d5bf3ff726f2dbab09652ae34974 (diff)
downloadwarden-7e08464b2a42048ebb5128bec5731719cf8bd1db.tar.bz2
warden-7e08464b2a42048ebb5128bec5731719cf8bd1db.zip
feat: create transaction schema
Diffstat (limited to 'migrations/20260329120645_transaction_schema.sql')
-rw-r--r--migrations/20260329120645_transaction_schema.sql18
1 files changed, 18 insertions, 0 deletions
diff --git a/migrations/20260329120645_transaction_schema.sql b/migrations/20260329120645_transaction_schema.sql
new file mode 100644
index 0000000..d7b4744
--- /dev/null
+++ b/migrations/20260329120645_transaction_schema.sql
@@ -0,0 +1,18 @@
+-- Add migration script here
+-- The transaction's blueprint to be checked on each request
+create table transaction_schema (
+ -- The transaction type
+ type text not null,
+ -- The schema's version (to allow for multiple revisions - maybe)
+ version varchar not null,
+ -- Actual JSON schema
+ json_schema jsonb not null,
+ created_at timestamptz not null default now(),
+ updated_at timestamptz not null default now(),
+ primary key (type, version)
+);
+
+create trigger update_transaction_schema_modtime
+ before update on transaction_schema
+ for each row
+ execute function update_updated_at_column();