Make sure copied migrations are named via utc timezone
This commit is contained in:
parent
5a10155755
commit
23398ae552
2 changed files with 5 additions and 3 deletions
|
@ -36,7 +36,7 @@ class CwToActivestorageGenerator < Rails::Generators::Base
|
|||
def create_column_migration_file
|
||||
if (Dir.glob("db/migrate/*_rename_uploader_columns.rb").none?)
|
||||
copy_file "migrate/rename_uploader_columns.rb",
|
||||
"db/migrate/#{(DateTime.now + 1.second).strftime('%Y%m%d%H%M%S')}_rename_uploader_columns.rb"
|
||||
"db/migrate/#{(DateTime.now.utc + 1.second).strftime('%Y%m%d%H%M%S')}_rename_uploader_columns.rb"
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -107,9 +107,11 @@ end
|
|||
end
|
||||
|
||||
task :create_backup_uploader_migration do
|
||||
byebug
|
||||
if (Dir.glob("db/migrate/*_backup_uploader_columns.rb").none?)
|
||||
FileUtils.cp __dir + "/templates/backup_uploader_columns.rb",
|
||||
"db/migrate/#{(DateTime.now + 1.second).strftime('%Y%m%d%H%M%S')}_backup_uploader_columns.rb"
|
||||
byebug
|
||||
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.rb"
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue