Working tree is now the canonical repo. Off-chain play-money + trustless on-chain (FPMM AMM + CLOB via UMA settlement), AI market factory, creator/social/distribution, mobile shell + push, one-command demo + deploy-kit. Secrets excluded (see ENV-AND-KEYS.md). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
57 lines
1.5 KiB
SQL
57 lines
1.5 KiB
SQL
-- This file is autogenerated from regen-schema.ts
|
|
create table if not exists
|
|
txns (
|
|
amount numeric not null,
|
|
category text not null,
|
|
created_time timestamp with time zone default now() not null,
|
|
data jsonb not null,
|
|
from_id text not null,
|
|
from_type text not null,
|
|
id text primary key default random_alphanumeric (8) not null,
|
|
to_id text not null,
|
|
to_type text not null,
|
|
token text default 'M$'::text not null constraint txns_token_check check (
|
|
(
|
|
token = any (
|
|
array[
|
|
'M$'::text,
|
|
'CASH'::text,
|
|
'SHARE'::text,
|
|
'SPICE'::text
|
|
]
|
|
)
|
|
)
|
|
)
|
|
);
|
|
|
|
-- Row Level Security
|
|
alter table txns enable row level security;
|
|
|
|
-- Policies
|
|
drop policy if exists "public read" on txns;
|
|
|
|
-- Indexes
|
|
drop index if exists txns_category_native;
|
|
|
|
create index txns_category_native on public.txns using btree (category);
|
|
|
|
drop index if exists txns_category_to_id;
|
|
|
|
create index txns_category_to_id on public.txns using btree (category, to_id);
|
|
|
|
drop index if exists txns_category_to_id_from_id;
|
|
|
|
create index txns_category_to_id_from_id on public.txns using btree (category, to_id, from_id);
|
|
|
|
drop index if exists txns_from_created_time;
|
|
|
|
create index txns_from_created_time on public.txns using btree (from_id, created_time);
|
|
|
|
drop index if exists txns_pkey;
|
|
|
|
create unique index txns_pkey on public.txns using btree (id);
|
|
|
|
drop index if exists txns_to_created_time;
|
|
|
|
create index txns_to_created_time on public.txns using btree (to_id, created_time);
|