From f8366108193ffa361a71f588e9920b0b30e2a9d3 Mon Sep 17 00:00:00 2001 From: lukinovec Date: Tue, 14 Jan 2025 15:32:36 +0100 Subject: [PATCH] Put DROP OWNED BY into try/catch --- tests/RLS/TableManagerTest.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/RLS/TableManagerTest.php b/tests/RLS/TableManagerTest.php index 87f207c4..bbd400a7 100644 --- a/tests/RLS/TableManagerTest.php +++ b/tests/RLS/TableManagerTest.php @@ -543,7 +543,10 @@ test('user without BYPASSRLS can only query owned tables if forceRls is true', f // Drop all tables created in beforeEach DB::statement("DROP TABLE authors, categories, posts, comments, reactions, articles;"); - DB::statement("DROP OWNED BY administrator;"); + try { + DB::statement("DROP OWNED BY administrator;"); + } catch (\Throwable $th) {} + DB::statement("DROP USER IF EXISTS administrator;"); // Create new central user (without superuser and bypassrls privileges)