template-saas-database-v2/ddl/01-schemas.sql
rckrdmrd 3ce06fbce4 Initial commit - Database de template-saas migrado desde monorepo
Migración desde workspace-v2/projects/template-saas/apps/database
Este repositorio es parte del estándar multi-repo v2

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 08:07:11 -06:00

37 lines
1.6 KiB
SQL

-- ============================================
-- TEMPLATE-SAAS: Schema Creation
-- Version: 1.0.0
-- ============================================
-- Core schemas
CREATE SCHEMA IF NOT EXISTS auth;
CREATE SCHEMA IF NOT EXISTS tenants;
CREATE SCHEMA IF NOT EXISTS users;
CREATE SCHEMA IF NOT EXISTS billing;
CREATE SCHEMA IF NOT EXISTS plans;
-- Feature schemas
CREATE SCHEMA IF NOT EXISTS audit;
CREATE SCHEMA IF NOT EXISTS notifications;
CREATE SCHEMA IF NOT EXISTS feature_flags;
CREATE SCHEMA IF NOT EXISTS storage;
CREATE SCHEMA IF NOT EXISTS ai;
CREATE SCHEMA IF NOT EXISTS webhooks;
-- Integration schemas
CREATE SCHEMA IF NOT EXISTS whatsapp;
-- Comments
COMMENT ON SCHEMA auth IS 'Authentication: sessions, tokens, OAuth';
COMMENT ON SCHEMA tenants IS 'Multi-tenancy: tenant configuration and settings';
COMMENT ON SCHEMA users IS 'User management: profiles, roles, permissions';
COMMENT ON SCHEMA billing IS 'Billing: subscriptions, invoices, payments';
COMMENT ON SCHEMA plans IS 'Plans: pricing plans, features, limits';
COMMENT ON SCHEMA audit IS 'Audit: activity logs, audit trail';
COMMENT ON SCHEMA notifications IS 'Notifications: templates, queue, delivery logs';
COMMENT ON SCHEMA feature_flags IS 'Feature flags: flags, rollouts, experiments';
COMMENT ON SCHEMA storage IS 'Storage: files, metadata, CDN';
COMMENT ON SCHEMA ai IS 'AI Integration: configurations, usage tracking, rate limits';
COMMENT ON SCHEMA webhooks IS 'Webhooks: outbound webhooks, deliveries, event dispatch';
COMMENT ON SCHEMA whatsapp IS 'WhatsApp: Business API integration, messages, configuration';