Added a migration generator

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1477 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
上级 996fa152
class MigrationGenerator < Rails::Generator::NamedBase
def manifest
record do |m|
m.directory File.join('db/migrate')
next_migration_number = Dir.glob("db/migrate/[0-9]*.*").size + 1
m.template 'migration.rb', File.join('db/migrate', "#{next_migration_number}_#{file_name}.rb")
end
end
end
class <%= class_name %> < ActiveRecord::Migration
def self.up
end
def self.down
end
end
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册