mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 16:01:20 +08:00
FIX: Create readonly functions during backup
Temporarily recreate already dropped functions in the discourse_functions schema in order to allow restoring of backups which still reference dropped functions.
This commit is contained in:
@ -28,13 +28,11 @@ module Migration
|
||||
end
|
||||
end
|
||||
|
||||
def self.drop_readonly(table, column)
|
||||
DB.exec <<~SQL
|
||||
DROP FUNCTION IF EXISTS #{BaseDropper.readonly_function_name(table, column)} CASCADE;
|
||||
-- Backward compatibility for old functions created in the public
|
||||
-- schema
|
||||
DROP FUNCTION IF EXISTS #{BaseDropper.old_readonly_function_name(table, column)} CASCADE;
|
||||
SQL
|
||||
def self.drop_readonly(table_name, column_name)
|
||||
BaseDropper.drop_readonly_function(table_name, column_name)
|
||||
|
||||
# Backward compatibility for old functions created in the public schema
|
||||
DB.exec("DROP FUNCTION IF EXISTS #{BaseDropper.old_readonly_function_name(table_name, column_name)} CASCADE")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user