2018-12-13 13:39:08 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2017-08-17 22:00:37 +05:30
|
|
|
require 'rails/generators'
|
|
|
|
|
|
|
|
module Rails
|
|
|
|
class PostDeploymentMigrationGenerator < Rails::Generators::NamedBase
|
|
|
|
def create_migration_file
|
2019-12-26 22:10:19 +05:30
|
|
|
timestamp = Time.now.utc.strftime('%Y%m%d%H%M%S')
|
2017-08-17 22:00:37 +05:30
|
|
|
|
|
|
|
template "migration.rb", "db/post_migrate/#{timestamp}_#{file_name}.rb"
|
|
|
|
end
|
|
|
|
|
|
|
|
def migration_class_name
|
|
|
|
file_name.camelize
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|