added more support for supabase-js
This commit is contained in:
15
migrations/20260312000000_add_mfa.sql
Normal file
15
migrations/20260312000000_add_mfa.sql
Normal file
@@ -0,0 +1,15 @@
|
||||
-- Add MFA Factors table
|
||||
CREATE SCHEMA IF NOT EXISTS auth;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS auth.mfa_factors (
|
||||
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
|
||||
user_id UUID NOT NULL REFERENCES public.users(id) ON DELETE CASCADE,
|
||||
factor_type TEXT NOT NULL, -- e.g., 'totp'
|
||||
secret TEXT NOT NULL,
|
||||
status TEXT NOT NULL CHECK (status IN ('unverified', 'verified')),
|
||||
created_at TIMESTAMPTZ DEFAULT now(),
|
||||
updated_at TIMESTAMPTZ DEFAULT now()
|
||||
);
|
||||
|
||||
-- Index for faster lookup by user
|
||||
CREATE INDEX IF NOT EXISTS idx_mfa_factors_user_id ON auth.mfa_factors(user_id);
|
||||
14
migrations/20260312000001_add_sso.sql
Normal file
14
migrations/20260312000001_add_sso.sql
Normal file
@@ -0,0 +1,14 @@
|
||||
CREATE SCHEMA IF NOT EXISTS auth;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS auth.sso_providers (
|
||||
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
|
||||
resource_id TEXT, -- e.g. project_ref or tenant_id
|
||||
domain TEXT UNIQUE NOT NULL, -- e.g. "acme.com"
|
||||
oidc_issuer_url TEXT NOT NULL,
|
||||
oidc_client_id TEXT NOT NULL,
|
||||
oidc_client_secret TEXT NOT NULL,
|
||||
created_at TIMESTAMPTZ DEFAULT now(),
|
||||
updated_at TIMESTAMPTZ DEFAULT now()
|
||||
);
|
||||
|
||||
CREATE INDEX IF NOT EXISTS idx_sso_providers_domain ON auth.sso_providers(domain);
|
||||
12
migrations/20260312000002_functions_schema.sql
Normal file
12
migrations/20260312000002_functions_schema.sql
Normal file
@@ -0,0 +1,12 @@
|
||||
CREATE SCHEMA IF NOT EXISTS functions;
|
||||
|
||||
CREATE TABLE functions.functions (
|
||||
id UUID PRIMARY KEY DEFAULT uuid_generate_v4(),
|
||||
name TEXT NOT NULL UNIQUE,
|
||||
code BYTEA NOT NULL,
|
||||
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
|
||||
updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
|
||||
);
|
||||
|
||||
-- Index for faster lookup by name
|
||||
CREATE INDEX idx_functions_name ON functions.functions(name);
|
||||
5
migrations/20260312000003_add_function_runtime.sql
Normal file
5
migrations/20260312000003_add_function_runtime.sql
Normal file
@@ -0,0 +1,5 @@
|
||||
-- Add runtime column to functions table
|
||||
ALTER TABLE functions.functions ADD COLUMN runtime TEXT NOT NULL DEFAULT 'wasm';
|
||||
|
||||
-- Ensure existing functions default to wasm (covered by DEFAULT, but good to be explicit if DEFAULT is removed later)
|
||||
-- UPDATE functions.functions SET runtime = 'wasm' WHERE runtime IS NULL;
|
||||
Reference in New Issue
Block a user