13 lines
816 B
SQL
13 lines
816 B
SQL
-- 1. Donner l'accès au schéma public
|
|
GRANT USAGE ON SCHEMA public TO anon, authenticated, service_role;
|
|
|
|
-- 2. Donner les droits CRUD (Create, Read, Update, Delete) sur TOUTES les tables existantes
|
|
GRANT SELECT, INSERT, UPDATE, DELETE ON ALL TABLES IN SCHEMA public TO anon, authenticated, service_role;
|
|
|
|
-- 3. Donner les droits sur TOUTES les séquences (indispensable pour les ID auto-incrémentés)
|
|
GRANT USAGE, SELECT ON ALL SEQUENCES IN SCHEMA public TO anon, authenticated, service_role;
|
|
|
|
-- 4. S'assurer que les tables créées DANS LE FUTUR auront aussi ces droits
|
|
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT, INSERT, UPDATE, DELETE ON TABLES TO anon, authenticated, service_role;
|
|
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT USAGE, SELECT ON SEQUENCES TO anon, authenticated, service_role;
|