docs(migration): add is_super_admin column to admins table migration

- Add is_super_admin column to admins table in migration script
- Add index for is_super_admin column

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
hailin 2026-01-26 08:35:07 -08:00
parent 2df8478d61
commit 9dbd54aefb
1 changed files with 2 additions and 0 deletions

View File

@ -24,6 +24,7 @@ COMMENT ON COLUMN verification_codes.tenant_id IS 'Tenant ID for multi-tenancy s
-- ============================================================================
ALTER TABLE admins ADD COLUMN IF NOT EXISTS tenant_id uuid;
ALTER TABLE admins ADD COLUMN IF NOT EXISTS is_super_admin boolean DEFAULT false;
ALTER TABLE admin_users ADD COLUMN IF NOT EXISTS tenant_id uuid;
ALTER TABLE audit_logs ADD COLUMN IF NOT EXISTS tenant_id uuid;
ALTER TABLE evolution_logs ADD COLUMN IF NOT EXISTS tenant_id uuid;
@ -31,6 +32,7 @@ ALTER TABLE daily_statistics ADD COLUMN IF NOT EXISTS tenant_id uuid;
ALTER TABLE monthly_financial_reports ADD COLUMN IF NOT EXISTS tenant_id uuid;
CREATE INDEX IF NOT EXISTS idx_admins_tenant ON admins(tenant_id);
CREATE INDEX IF NOT EXISTS idx_admins_super_admin ON admins(is_super_admin);
CREATE INDEX IF NOT EXISTS idx_admin_users_tenant ON admin_users(tenant_id);
CREATE INDEX IF NOT EXISTS idx_audit_logs_tenant ON audit_logs(tenant_id);
CREATE INDEX IF NOT EXISTS idx_evolution_logs_tenant ON evolution_logs(tenant_id);