2018-10-08 14:50:39 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2016-11-01 20:44:27 +00:00
|
|
|
require 'rails/generators'
|
|
|
|
|
2021-08-13 18:09:11 +00:00
|
|
|
module PostDeploymentMigration
|
2016-10-27 12:36:53 +00:00
|
|
|
class PostDeploymentMigrationGenerator < Rails::Generators::NamedBase
|
|
|
|
def create_migration_file
|
2019-10-30 12:06:34 +00:00
|
|
|
timestamp = Time.now.utc.strftime('%Y%m%d%H%M%S')
|
2016-10-27 12:36:53 +00:00
|
|
|
|
|
|
|
template "migration.rb", "db/post_migrate/#{timestamp}_#{file_name}.rb"
|
|
|
|
end
|
|
|
|
|
|
|
|
def migration_class_name
|
|
|
|
file_name.camelize
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|