Fix: Remove .select() from delete operations

This commit is contained in:
gpt-engineer-app[bot]
2025-11-04 16:42:23 +00:00
parent c904fe10a1
commit 06c004d5fe
2 changed files with 53 additions and 5 deletions

View File

@@ -0,0 +1,42 @@
-- Allow moderators to delete test data from version tables
-- This enables test data cleanup operations to work properly
-- Park versions
CREATE POLICY "Moderators can delete test park versions"
ON park_versions
FOR DELETE
TO authenticated
USING (
is_test_data = true
AND is_moderator(auth.uid())
);
-- Ride versions
CREATE POLICY "Moderators can delete test ride versions"
ON ride_versions
FOR DELETE
TO authenticated
USING (
is_test_data = true
AND is_moderator(auth.uid())
);
-- Company versions
CREATE POLICY "Moderators can delete test company versions"
ON company_versions
FOR DELETE
TO authenticated
USING (
is_test_data = true
AND is_moderator(auth.uid())
);
-- Ride model versions
CREATE POLICY "Moderators can delete test ride model versions"
ON ride_model_versions
FOR DELETE
TO authenticated
USING (
is_test_data = true
AND is_moderator(auth.uid())
);