1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Added a migration generator

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1477 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
David Heinemeier Hansson 2005-06-22 10:09:01 +00:00
parent 996fa1526d
commit 2694b8cf27
2 changed files with 16 additions and 0 deletions

View file

@ -0,0 +1,9 @@
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

View file

@ -0,0 +1,7 @@
class <%= class_name %> < ActiveRecord::Migration
def self.up
end
def self.down
end
end