Correct the check for not overriding migrations
This commit is contained in:
parent
97083a38af
commit
be85ea737e
2 changed files with 3 additions and 3 deletions
|
@ -34,7 +34,7 @@ class CwToActivestorageGenerator < Rails::Generators::Base
|
||||||
end
|
end
|
||||||
|
|
||||||
def create_column_migration_file
|
def create_column_migration_file
|
||||||
if (Dir.glob("db/migrate/*_rename_uploader_columns.rb").none?)
|
if (Dir.glob("db/migrate/*_rename_uploader_columns.houdini_upgrade.rb").none?)
|
||||||
copy_file "migrate/rename_uploader_columns.rb",
|
copy_file "migrate/rename_uploader_columns.rb",
|
||||||
"db/migrate/#{(DateTime.now.utc + 1.second).strftime('%Y%m%d%H%M%S')}_rename_uploader_columns.houdini_upgrade.rb"
|
"db/migrate/#{(DateTime.now.utc + 1.second).strftime('%Y%m%d%H%M%S')}_rename_uploader_columns.houdini_upgrade.rb"
|
||||||
end
|
end
|
||||||
|
|
|
@ -107,14 +107,14 @@ end
|
||||||
end
|
end
|
||||||
|
|
||||||
task :create_backup_uploader_migration do
|
task :create_backup_uploader_migration do
|
||||||
if (Dir.glob("db/migrate/*_backup_uploader_columns.rb").none?)
|
if (Dir.glob("db/migrate/*_backup_uploader_columns.houdini_upgrade.rb").none?)
|
||||||
FileUtils.cp __dir__ + "/templates/backup_uploader_columns.rb",
|
FileUtils.cp __dir__ + "/templates/backup_uploader_columns.rb",
|
||||||
"db/migrate/#{(DateTime.now.utc + 1.second).strftime('%Y%m%d%H%M%S')}_backup_uploader_columns.houdini_upgrade.rb"
|
"db/migrate/#{(DateTime.now.utc + 1.second).strftime('%Y%m%d%H%M%S')}_backup_uploader_columns.houdini_upgrade.rb"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
task :delete_uploader_backup_tables_migration do
|
task :delete_uploader_backup_tables_migration do
|
||||||
if (Dir.glob("db/migrate/*_backup_uploader_columns.rb").none?)
|
if (Dir.glob("db/migrate/*_backup_uploader_columns.houdini_upgrade.rb").none?)
|
||||||
FileUtils.cp __dir + "/templates/delete_uploader_backup_tables.rb",
|
FileUtils.cp __dir + "/templates/delete_uploader_backup_tables.rb",
|
||||||
"db/migrate/#{(DateTime.now + 1.second).strftime('%Y%m%d%H%M%S')}_delete_uploader_backup_tables.houdini_upgrade.rb"
|
"db/migrate/#{(DateTime.now + 1.second).strftime('%Y%m%d%H%M%S')}_delete_uploader_backup_tables.houdini_upgrade.rb"
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue