smart_ide/services/docv/docv-back/migrations/20260403140000_roles_minimal.sql
Nicolas Cantu 01860b7af7 chore: remove gitmodules, add docv workspace crates, update systemd README
- Drop .gitmodules (ia_dev tracked as submodule pointer without file)
- Add services/docv Cargo workspace: docv-back, docv-shared, migrations, sources
- Refresh systemd/README.md
2026-04-03 17:55:50 +02:00

11 lines
513 B
SQL

-- Rôles par office : requis lorsque office_members référence roles (role_uid IMPL / extensions).
-- Si la table existe déjà avec un autre schéma, cette commande ne fait rien (IF NOT EXISTS).
CREATE TABLE IF NOT EXISTS roles (
uid UUID PRIMARY KEY DEFAULT gen_random_uuid(),
office_uid UUID REFERENCES offices(uid) ON DELETE CASCADE,
name TEXT NOT NULL DEFAULT 'Member',
created_at TIMESTAMPTZ NOT NULL DEFAULT now()
);
CREATE INDEX IF NOT EXISTS idx_roles_office_uid ON roles(office_uid);