Run SQL migration for Mercado Pago payments.
This commit is contained in:
parent
ac6b5208ca
commit
038c131b3b
@ -371,6 +371,39 @@ export type Database = {
|
|||||||
}
|
}
|
||||||
Relationships: []
|
Relationships: []
|
||||||
}
|
}
|
||||||
|
pagamentos_mercadopago: {
|
||||||
|
Row: {
|
||||||
|
created_at: string
|
||||||
|
event_id: string | null
|
||||||
|
event_type: string
|
||||||
|
id: string
|
||||||
|
payer_email: string | null
|
||||||
|
raw_body: Json
|
||||||
|
status: string | null
|
||||||
|
user_id: string | null
|
||||||
|
}
|
||||||
|
Insert: {
|
||||||
|
created_at?: string
|
||||||
|
event_id?: string | null
|
||||||
|
event_type: string
|
||||||
|
id?: string
|
||||||
|
payer_email?: string | null
|
||||||
|
raw_body: Json
|
||||||
|
status?: string | null
|
||||||
|
user_id?: string | null
|
||||||
|
}
|
||||||
|
Update: {
|
||||||
|
created_at?: string
|
||||||
|
event_id?: string | null
|
||||||
|
event_type?: string
|
||||||
|
id?: string
|
||||||
|
payer_email?: string | null
|
||||||
|
raw_body?: Json
|
||||||
|
status?: string | null
|
||||||
|
user_id?: string | null
|
||||||
|
}
|
||||||
|
Relationships: []
|
||||||
|
}
|
||||||
perfis_usuario: {
|
perfis_usuario: {
|
||||||
Row: {
|
Row: {
|
||||||
aniversario: string | null
|
aniversario: string | null
|
||||||
|
|||||||
@ -0,0 +1,27 @@
|
|||||||
|
|
||||||
|
-- Criação da tabela para registrar notificações de Webhook do Mercado Pago
|
||||||
|
create table public.pagamentos_mercadopago (
|
||||||
|
id uuid not null default gen_random_uuid() primary key,
|
||||||
|
raw_body jsonb not null,
|
||||||
|
event_type text not null,
|
||||||
|
event_id text,
|
||||||
|
payer_email text,
|
||||||
|
user_id uuid,
|
||||||
|
status text,
|
||||||
|
created_at timestamp with time zone not null default now()
|
||||||
|
);
|
||||||
|
|
||||||
|
-- Habilita Row Level Security
|
||||||
|
alter table public.pagamentos_mercadopago enable row level security;
|
||||||
|
|
||||||
|
-- Política de insert para funções autenticadas
|
||||||
|
create policy "Allow insert for authenticated functions" on public.pagamentos_mercadopago
|
||||||
|
for insert
|
||||||
|
to authenticated
|
||||||
|
with check (true);
|
||||||
|
|
||||||
|
-- Política de select para usuários autenticados
|
||||||
|
create policy "Allow select for authenticated users" on public.pagamentos_mercadopago
|
||||||
|
for select
|
||||||
|
to authenticated
|
||||||
|
using (true);
|
||||||
Loading…
Reference in New Issue
Block a user