aboutsummaryrefslogtreecommitdiffstats
path: root/migrations/20260329120645_transaction_schema.sql
blob: 786859184342f96e1f43dcf3045bc712f7bbe17b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
-- Add migration script here
-- The transaction's blueprint to be checked on each request
create table transaction_schema (
    id bigserial primary key,
    -- The transaction type
    schema_type text not null,
    -- The schema's version (to allow for multiple revisions - maybe)
    schema_version varchar not null,
    -- Actual JSON schema
    schema jsonb not null,
    created_at timestamptz not null default now(),
    updated_at timestamptz not null default now(),
    unique (schema_type, schema_version)
);

create trigger update_transaction_schema_modtime
    before update on transaction_schema
    for each row
    execute function update_updated_at_column();