Fix migration in cases where database name has a hyphen
authorMark Felder <feld@feld.me>
Wed, 3 Mar 2021 00:17:32 +0000 (18:17 -0600)
committerMark Felder <feld@feld.me>
Wed, 3 Mar 2021 00:17:32 +0000 (18:17 -0600)
priv/repo/migrations/20210121080964_add_default_text_search_config.exs

index 09b6cccc9830006d68a5db65ae29f74ba666adc1..27f600b705551f709d2a8aea472d60903447c558 100644 (file)
@@ -4,7 +4,7 @@ defmodule Pleroma.Repo.Migrations.AddDefaultTextSearchConfig do
   def change do
     execute("DO $$
     BEGIN
-    execute 'ALTER DATABASE '||current_database()||' SET default_text_search_config = ''english'' ';
+    execute 'ALTER DATABASE \"'||current_database()||'\" SET default_text_search_config = ''english'' ';
     END
     $$;")
   end