DROP POLICY IF EXISTS audit_log_admin_select ON public.audit_log;
DROP POLICY IF EXISTS ssh_keys_member_select ON public.ssh_keys;
DROP POLICY IF EXISTS vms_member_select ON public.vms;
DROP POLICY IF EXISTS project_quotas_member_select ON public.project_quotas;
DROP POLICY IF EXISTS projects_member_select ON public.projects;
DROP POLICY IF EXISTS memberships_member_select ON public.memberships;
DROP POLICY IF EXISTS tenants_member_select ON public.tenants;

ALTER TABLE public.audit_log DISABLE ROW LEVEL SECURITY;
ALTER TABLE public.ssh_keys DISABLE ROW LEVEL SECURITY;
ALTER TABLE public.vms DISABLE ROW LEVEL SECURITY;
ALTER TABLE public.project_quotas DISABLE ROW LEVEL SECURITY;
ALTER TABLE public.projects DISABLE ROW LEVEL SECURITY;
ALTER TABLE public.memberships DISABLE ROW LEVEL SECURITY;
ALTER TABLE public.tenants DISABLE ROW LEVEL SECURITY;

DROP FUNCTION IF EXISTS public.has_tenant_role(uuid, public.membership_role[]);
DROP FUNCTION IF EXISTS public.is_tenant_member(uuid);
DROP FUNCTION IF EXISTS public.current_profile_id();
