Commit ddcc5eda authored by Adam Hegyi's avatar Adam Hegyi

Add OR REPLACE when creating function

This change fixes the broken restore process when re-running the
migrations after a restore.
parent 9c60a1fb
...@@ -6,7 +6,7 @@ class AddFunctionForInsertingDeletedRecords < ActiveRecord::Migration[6.1] ...@@ -6,7 +6,7 @@ class AddFunctionForInsertingDeletedRecords < ActiveRecord::Migration[6.1]
def up def up
execute(<<~SQL) execute(<<~SQL)
CREATE FUNCTION #{DELETED_RECORDS_INSERT_FUNCTION_NAME}() CREATE OR REPLACE FUNCTION #{DELETED_RECORDS_INSERT_FUNCTION_NAME}()
RETURNS TRIGGER AS RETURNS TRIGGER AS
$$ $$
BEGIN BEGIN
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment