-- 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);