Skip to content

Commit

Permalink
reconcile prod vs dev sql: bet_id pkey
Browse files Browse the repository at this point in the history
  • Loading branch information
sipec committed Nov 11, 2024
1 parent d15d8fe commit 53b697d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
6 changes: 5 additions & 1 deletion backend/supabase/contract_bets.sql
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ create table if not exists
contract_bets (
amount numeric,
answer_id text,
bet_id text default random_alphanumeric (12) not null,
bet_id text primary key default random_alphanumeric (12) not null,
contract_id text not null,
created_time timestamp with time zone default now() not null,
data jsonb not null,
Expand Down Expand Up @@ -101,6 +101,10 @@ drop index if exists contract_bets_historical_probs;

create index contract_bets_historical_probs on public.contract_bets using btree (contract_id, answer_id, created_time desc) include (prob_before, prob_after);

drop index if exists contract_bets_pkey;

create unique index contract_bets_pkey on public.contract_bets using btree (bet_id);

drop index if exists contract_bets_user_id_created_time;

create index contract_bets_user_id_created_time on public.contract_bets using btree (user_id, created_time desc);
Expand Down
2 changes: 1 addition & 1 deletion backend/supabase/user_reactions.sql
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ create table if not exists
content_type text not null,
created_time timestamp with time zone default now() not null,
reaction_id text default random_alphanumeric (12) not null,
reaction_type text default 'like'::character varying,
reaction_type text default 'like'::text not null,
user_id text not null,
constraint primary key (user_id, reaction_id)
);
Expand Down
6 changes: 3 additions & 3 deletions common/src/supabase/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2967,7 +2967,7 @@ export type Database = {
content_type: string
created_time: string
reaction_id: string
reaction_type: string | null
reaction_type: string
user_id: string
}
Insert: {
Expand All @@ -2976,7 +2976,7 @@ export type Database = {
content_type: string
created_time?: string
reaction_id?: string
reaction_type?: string | null
reaction_type?: string
user_id: string
}
Update: {
Expand All @@ -2985,7 +2985,7 @@ export type Database = {
content_type?: string
created_time?: string
reaction_id?: string
reaction_type?: string | null
reaction_type?: string
user_id?: string
}
Relationships: []
Expand Down

0 comments on commit 53b697d

Please sign in to comment.