-- ============================================
-- TEMPLATE-SAAS: Commissions Schema
-- Version: 1.0.0
-- Module: SAAS-020
-- ============================================

-- Create schema
CREATE SCHEMA IF NOT EXISTS commissions;

-- Grant permissions
GRANT USAGE ON SCHEMA commissions TO template_saas_app;
GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA commissions TO template_saas_app;
GRANT ALL PRIVILEGES ON ALL SEQUENCES IN SCHEMA commissions TO template_saas_app;

-- Default privileges for future tables
ALTER DEFAULT PRIVILEGES IN SCHEMA commissions
  GRANT ALL PRIVILEGES ON TABLES TO template_saas_app;
ALTER DEFAULT PRIVILEGES IN SCHEMA commissions
  GRANT ALL PRIVILEGES ON SEQUENCES TO template_saas_app;
