mirror of
https://github.com/mastodon/mastodon.git
synced 2024-10-20 17:51:25 +09:00
18 lines
469 B
Ruby
18 lines
469 B
Ruby
# frozen_string_literal: true
|
|
|
|
require 'rails/generators/active_record'
|
|
|
|
class PostDeploymentMigrationGenerator < Rails::Generators::NamedBase
|
|
source_root File.expand_path('templates', __dir__)
|
|
|
|
include Rails::Generators::Migration
|
|
|
|
def create_post_deployment_migration
|
|
migration_template 'migration.erb', "db/post_migrate/#{file_name}.rb"
|
|
end
|
|
|
|
def self.next_migration_number(path)
|
|
ActiveRecord::Generators::Base.next_migration_number(path)
|
|
end
|
|
end
|