Skip to content

Commit

Permalink
Added failing test for AutoRefresh triggers
Browse files Browse the repository at this point in the history
  • Loading branch information
mpscholten committed Aug 8, 2024
1 parent 1ad92f0 commit 07873b4
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions Test/IDE/CodeGeneration/MigrationGenerator.hs
Original file line number Diff line number Diff line change
Expand Up @@ -1362,6 +1362,17 @@ CREATE POLICY "Users can read and edit their own record" ON public.users USING (

diffSchemas targetSchema actualSchema `shouldBe` migration

it "should ignore ar_did_update_.. triggers by IHP.AutoRefresh" do
let actualSchema = sql $ cs [plain|
CREATE TRIGGER ar_did_update_plans AFTER UPDATE ON public.plans FOR EACH ROW EXECUTE FUNCTION public.notify_did_change_plans();
CREATE TRIGGER ar_did_insert_offices AFTER INSERT ON public.offices FOR EACH STATEMENT EXECUTE FUNCTION public.notify_did_change_offices();
CREATE TRIGGER ar_did_delete_company_profiles AFTER DELETE ON public.company_profiles FOR EACH STATEMENT EXECUTE FUNCTION public.notify_did_change_company_profiles();
|]
let targetSchema = []
let migration = []

diffSchemas targetSchema actualSchema `shouldBe` migration

it "should deal with truncated identifiers" do
let actualSchema = sql $ cs [plain|
CREATE POLICY "Users can manage the prepare_context_jobs if they can see the C" ON public.prepare_context_jobs USING ((EXISTS ( SELECT 1
Expand Down

0 comments on commit 07873b4

Please sign in to comment.