mirror of
https://github.com/discourse/discourse.git
synced 2025-05-21 18:12:32 +08:00
FIX: Check all migrations for dropped columns/tables during restore
Previously only post-deploy migrations were being checked for DROPPED_(COLUMNS|TABLES) constants
This commit is contained in:
@ -51,6 +51,11 @@ module BackupRestore
|
||||
end
|
||||
end
|
||||
|
||||
def self.core_migration_files
|
||||
Dir[Rails.root.join(Migration::SafeMigrate.post_migration_path, "**/*.rb")] +
|
||||
Dir[Rails.root.join("db/migrate/*.rb")]
|
||||
end
|
||||
|
||||
protected
|
||||
|
||||
def restore_dump
|
||||
@ -154,7 +159,7 @@ module BackupRestore
|
||||
@created_functions_for_table_columns = []
|
||||
all_readonly_table_columns = []
|
||||
|
||||
Dir[Rails.root.join(Migration::SafeMigrate.post_migration_path, "**/*.rb")].each do |path|
|
||||
DatabaseRestorer.core_migration_files.each do |path|
|
||||
require path
|
||||
class_name = File.basename(path, ".rb").sub(/^\d+_/, "").camelize
|
||||
migration_class = class_name.constantize
|
||||
|
Reference in New Issue
Block a user