2016-11-01 20:44:27 +00:00
|
|
|
require 'rails/generators'
|
|
|
|
|
2016-10-27 12:36:53 +00:00
|
|
|
module Rails
|
|
|
|
class PostDeploymentMigrationGenerator < Rails::Generators::NamedBase
|
|
|
|
def create_migration_file
|
2018-03-12 17:24:36 +00:00
|
|
|
timestamp = Time.now.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
|