migrations for 2 tables
This commit is contained in:
18
db/migrations/20260102182136_tenant_ecommerce_config.sql
Normal file
18
db/migrations/20260102182136_tenant_ecommerce_config.sql
Normal file
@@ -0,0 +1,18 @@
|
||||
-- migrate:up
|
||||
CREATE TABLE tenant_ecommerce_config (
|
||||
id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
|
||||
tenant_id uuid NOT NULL REFERENCES tenants(id) ON DELETE CASCADE,
|
||||
provider text NOT NULL CHECK (provider IN ('woo', 'shopify', 'custom', 'none')),
|
||||
base_url text NOT NULL,
|
||||
credential_key text NOT NULL,
|
||||
credential_secret text NOT NULL,
|
||||
api_version text,
|
||||
timeout_ms integer DEFAULT 8000,
|
||||
enabled boolean DEFAULT true,
|
||||
created_at timestamptz NOT NULL DEFAULT now(),
|
||||
updated_at timestamptz NOT NULL DEFAULT now(),
|
||||
UNIQUE (tenant_id, provider)
|
||||
);
|
||||
|
||||
-- migrate:down
|
||||
drop table if exists tenant_ecommerce_config;
|
||||
Reference in New Issue
Block a user