Agenda, Agendador, Configurações
This commit is contained in:
17
DBS/2026-03-11/supabase-snippets/Untitled query 790.sql
Normal file
17
DBS/2026-03-11/supabase-snippets/Untitled query 790.sql
Normal file
@@ -0,0 +1,17 @@
|
||||
create table if not exists public.subscriptions (
|
||||
id uuid primary key default gen_random_uuid(),
|
||||
user_id uuid not null references auth.users(id) on delete cascade,
|
||||
plan_key text not null,
|
||||
interval text not null check (interval in ('month','year')),
|
||||
status text not null check (status in ('active','canceled','past_due','trial')) default 'active',
|
||||
started_at timestamptz not null default now(),
|
||||
current_period_start timestamptz not null default now(),
|
||||
current_period_end timestamptz null,
|
||||
canceled_at timestamptz null,
|
||||
source text not null default 'manual',
|
||||
created_at timestamptz not null default now(),
|
||||
updated_at timestamptz not null default now()
|
||||
);
|
||||
|
||||
create index if not exists subscriptions_user_id_idx on public.subscriptions(user_id);
|
||||
create index if not exists subscriptions_status_idx on public.subscriptions(status);
|
||||
Reference in New Issue
Block a user