- 00-schema.sql: Schema creation with grants - 01-enums.sql: 8 enums (goal_type, metric_type, period_type, etc.) - 02-tables.sql: 4 tables (definitions, assignments, progress_log, milestone_notifications) - 04-rls.sql: 16 RLS policies for tenant isolation - 05-indexes.sql: Performance indexes Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
15 lines
602 B
SQL
15 lines
602 B
SQL
-- ============================================
|
|
-- SAAS-022: Goals Schema
|
|
-- Sistema de metas y objetivos
|
|
-- ============================================
|
|
|
|
-- Create schema
|
|
CREATE SCHEMA IF NOT EXISTS goals;
|
|
|
|
-- Grant permissions
|
|
GRANT USAGE ON SCHEMA goals TO template_saas_user;
|
|
GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA goals TO template_saas_user;
|
|
GRANT ALL PRIVILEGES ON ALL SEQUENCES IN SCHEMA goals TO template_saas_user;
|
|
ALTER DEFAULT PRIVILEGES IN SCHEMA goals GRANT ALL ON TABLES TO template_saas_user;
|
|
ALTER DEFAULT PRIVILEGES IN SCHEMA goals GRANT ALL ON SEQUENCES TO template_saas_user;
|