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>
42 lines
1.1 KiB
SQL
42 lines
1.1 KiB
SQL
-- This file is autogenerated from regen-schema.ts
|
|
create table if not exists
|
|
group_contracts (
|
|
contract_id text not null,
|
|
group_id text not null,
|
|
primary key (group_id, contract_id)
|
|
);
|
|
|
|
-- Foreign Keys
|
|
alter table group_contracts
|
|
add constraint group_contracts_group_id_fkey foreign key (group_id) references groups (id) on update cascade;
|
|
|
|
-- Row Level Security
|
|
alter table group_contracts enable row level security;
|
|
|
|
-- Policies
|
|
drop policy if exists "Enable read access for bets on markets user can access" on group_contracts;
|
|
|
|
create policy "Enable read access for bets on markets user can access" on group_contracts for
|
|
select
|
|
using (
|
|
(
|
|
exists (
|
|
select
|
|
1
|
|
from
|
|
groups
|
|
where
|
|
(groups.id = group_contracts.group_id)
|
|
)
|
|
)
|
|
);
|
|
|
|
-- Indexes
|
|
drop index if exists group_contracts_contract_id;
|
|
|
|
create index group_contracts_contract_id on public.group_contracts using btree (contract_id);
|
|
|
|
drop index if exists group_contracts_pkey;
|
|
|
|
create unique index group_contracts_pkey on public.group_contracts using btree (group_id, contract_id);
|