51 lines
2.8 KiB
SQL
51 lines
2.8 KiB
SQL
-- ============================================================================
|
|
-- REMOVER TODAS AS POLÍTICAS RLS DO SCHEMA 'rdo'
|
|
-- Execute este script no SQL Editor do Supabase
|
|
-- ============================================================================
|
|
|
|
-- Desabilitar RLS em todas as tabelas
|
|
ALTER TABLE rdo.usuarios DISABLE ROW LEVEL SECURITY;
|
|
ALTER TABLE rdo.organizacoes DISABLE ROW LEVEL SECURITY;
|
|
ALTER TABLE rdo.obras DISABLE ROW LEVEL SECURITY;
|
|
ALTER TABLE rdo.rdos DISABLE ROW LEVEL SECURITY;
|
|
ALTER TABLE rdo.rdo_atividades DISABLE ROW LEVEL SECURITY;
|
|
ALTER TABLE rdo.rdo_mao_obra DISABLE ROW LEVEL SECURITY;
|
|
ALTER TABLE rdo.rdo_equipamentos DISABLE ROW LEVEL SECURITY;
|
|
ALTER TABLE rdo.rdo_ocorrencias DISABLE ROW LEVEL SECURITY;
|
|
ALTER TABLE rdo.rdo_anexos DISABLE ROW LEVEL SECURITY;
|
|
ALTER TABLE rdo.rdo_inspecoes_solda DISABLE ROW LEVEL SECURITY;
|
|
ALTER TABLE rdo.rdo_verificacoes_torque DISABLE ROW LEVEL SECURITY;
|
|
ALTER TABLE rdo.tarefas DISABLE ROW LEVEL SECURITY;
|
|
ALTER TABLE rdo.inventario_equipamentos DISABLE ROW LEVEL SECURITY;
|
|
ALTER TABLE rdo.task_logs DISABLE ROW LEVEL SECURITY;
|
|
ALTER TABLE rdo.tipos_atividade DISABLE ROW LEVEL SECURITY;
|
|
ALTER TABLE rdo.condicoes_climaticas DISABLE ROW LEVEL SECURITY;
|
|
ALTER TABLE rdo.tipos_ocorrencia DISABLE ROW LEVEL SECURITY;
|
|
ALTER TABLE rdo.funcoes_cargos DISABLE ROW LEVEL SECURITY;
|
|
ALTER TABLE rdo.equipamentos DISABLE ROW LEVEL SECURITY;
|
|
ALTER TABLE rdo.materiais DISABLE ROW LEVEL SECURITY;
|
|
|
|
-- Dropar políticas existentes
|
|
DROP POLICY IF EXISTS "auth_all_rdo_usuarios" ON rdo.usuarios;
|
|
DROP POLICY IF EXISTS "auth_all_rdo_orgs" ON rdo.organizacoes;
|
|
DROP POLICY IF EXISTS "auth_all_rdo_obras" ON rdo.obras;
|
|
DROP POLICY IF EXISTS "auth_all_rdo_rdos" ON rdo.rdos;
|
|
DROP POLICY IF EXISTS "auth_all_rdo_ativ" ON rdo.rdo_atividades;
|
|
DROP POLICY IF EXISTS "auth_all_rdo_mao" ON rdo.rdo_mao_obra;
|
|
DROP POLICY IF EXISTS "auth_all_rdo_equip" ON rdo.rdo_equipamentos;
|
|
DROP POLICY IF EXISTS "auth_all_rdo_ocor" ON rdo.rdo_ocorrencias;
|
|
DROP POLICY IF EXISTS "auth_all_rdo_anex" ON rdo.rdo_anexos;
|
|
DROP POLICY IF EXISTS "auth_all_rdo_insp" ON rdo.rdo_inspecoes_solda;
|
|
DROP POLICY IF EXISTS "auth_all_rdo_torq" ON rdo.rdo_verificacoes_torque;
|
|
DROP POLICY IF EXISTS "auth_all_rdo_tarefas" ON rdo.tarefas;
|
|
DROP POLICY IF EXISTS "auth_all_rdo_inv_equip" ON rdo.inventario_equipamentos;
|
|
DROP POLICY IF EXISTS "auth_all_rdo_task_logs" ON rdo.task_logs;
|
|
DROP POLICY IF EXISTS "auth_all_rdo_tipos_ativ" ON rdo.tipos_atividade;
|
|
DROP POLICY IF EXISTS "auth_all_rdo_cond_clim" ON rdo.condicoes_climaticas;
|
|
DROP POLICY IF EXISTS "auth_all_rdo_tipos_ocor" ON rdo.tipos_ocorrencia;
|
|
DROP POLICY IF EXISTS "auth_all_rdo_func" ON rdo.funcoes_cargos;
|
|
DROP POLICY IF EXISTS "auth_all_rdo_equip" ON rdo.equipamentos;
|
|
DROP POLICY IF EXISTS "auth_all_rdo_materiais" ON rdo.materiais;
|
|
|
|
SELECT 'RLS desabilitado em todas as tabelas do schema rdo!' AS resultado;
|