- Add 06-triggers.sql with trg_files_updated_at and trg_usage_updated_at
for storage.files and storage.usage tables
- Fix RLS policies in whatsapp schema to use current_setting with true
parameter to avoid errors when app.current_tenant_id is not set
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Create missing trigger function required by MLM schema triggers.
The function updates the updated_at column to CURRENT_TIMESTAMP
on row updates for mlm.structures, mlm.ranks, and mlm.nodes tables.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Added `code` VARCHAR(50) NOT NULL for programmatic use
- Added `is_active` BOOLEAN DEFAULT TRUE
- Added `metadata` JSONB DEFAULT '{}'
- Added indexes for code and is_active
- Added unique constraint for code per tenant
Aligns DDL with role.entity.ts
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
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>