- Schema creation and grants - Enums: product_type, product_status, price_type, attribute_type - Tables: categories, products, variants, prices - RLS policies for tenant isolation - Performance indexes Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
42 lines
729 B
SQL
42 lines
729 B
SQL
-- ============================================
|
|
-- TEMPLATE-SAAS: Portfolio Enums
|
|
-- Version: 1.0.0
|
|
-- Module: SAAS-019
|
|
-- ============================================
|
|
|
|
-- Product type enum
|
|
CREATE TYPE portfolio.product_type AS ENUM (
|
|
'physical',
|
|
'digital',
|
|
'service',
|
|
'subscription',
|
|
'bundle'
|
|
);
|
|
|
|
-- Product status enum
|
|
CREATE TYPE portfolio.product_status AS ENUM (
|
|
'draft',
|
|
'active',
|
|
'inactive',
|
|
'discontinued',
|
|
'out_of_stock'
|
|
);
|
|
|
|
-- Price type enum
|
|
CREATE TYPE portfolio.price_type AS ENUM (
|
|
'one_time',
|
|
'recurring',
|
|
'usage_based',
|
|
'tiered'
|
|
);
|
|
|
|
-- Variant attribute type enum
|
|
CREATE TYPE portfolio.attribute_type AS ENUM (
|
|
'color',
|
|
'size',
|
|
'material',
|
|
'style',
|
|
'capacity',
|
|
'custom'
|
|
);
|