From fe7ea753a804cb8503cc82bb61c76d220ee32ad6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maksymilian=20Jod=C5=82owski?= Date: Wed, 1 Jan 2025 13:53:19 +0100 Subject: [PATCH] fix: Escape table_prefix with double quotes (#124) --- lib/carbonite/migrations.ex | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/carbonite/migrations.ex b/lib/carbonite/migrations.ex index 58eb5d2..e580fe7 100644 --- a/lib/carbonite/migrations.ex +++ b/lib/carbonite/migrations.ex @@ -126,7 +126,7 @@ defmodule Carbonite.Migrations do """ CREATE CONSTRAINT TRIGGER capture_changes_into_#{carbonite_prefix}_trigger AFTER INSERT OR UPDATE OR DELETE - ON #{table_prefix}.#{table_name} + ON "#{table_prefix}".#{table_name} DEFERRABLE INITIALLY #{initially} FOR EACH ROW EXECUTE PROCEDURE #{carbonite_prefix}.capture_changes(); @@ -183,7 +183,7 @@ defmodule Carbonite.Migrations do """ DROP TRIGGER capture_changes_into_#{carbonite_prefix}_trigger - ON #{table_prefix}.#{table_name}; + ON "#{table_prefix}".#{table_name}; """ |> squish_and_execute()