From 23398ae5522635d0023d89349f05aa3ad843d797 Mon Sep 17 00:00:00 2001 From: Eric Date: Tue, 5 May 2020 13:17:36 -0500 Subject: [PATCH] Make sure copied migrations are named via utc timezone --- .../cw_to_activestorage/cw_to_activestorage_generator.rb | 2 +- gems/houdini_upgrade/lib/tasks/houdini_upgrade_tasks.rake | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/gems/houdini_upgrade/lib/generators/cw_to_activestorage/cw_to_activestorage_generator.rb b/gems/houdini_upgrade/lib/generators/cw_to_activestorage/cw_to_activestorage_generator.rb index bf4f54f0..809a292d 100644 --- a/gems/houdini_upgrade/lib/generators/cw_to_activestorage/cw_to_activestorage_generator.rb +++ b/gems/houdini_upgrade/lib/generators/cw_to_activestorage/cw_to_activestorage_generator.rb @@ -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 diff --git a/gems/houdini_upgrade/lib/tasks/houdini_upgrade_tasks.rake b/gems/houdini_upgrade/lib/tasks/houdini_upgrade_tasks.rake index ccf57262..d7808d6b 100644 --- a/gems/houdini_upgrade/lib/tasks/houdini_upgrade_tasks.rake +++ b/gems/houdini_upgrade/lib/tasks/houdini_upgrade_tasks.rake @@ -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