mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
self.up, self.down => up, down
This commit is contained in:
parent
759906d512
commit
55b203dac1
3 changed files with 6 additions and 7 deletions
|
@ -150,7 +150,7 @@ A short rundown of some of the major features:
|
||||||
* Database agnostic schema management with Migrations.
|
* Database agnostic schema management with Migrations.
|
||||||
|
|
||||||
class AddSystemSettings < ActiveRecord::Migration
|
class AddSystemSettings < ActiveRecord::Migration
|
||||||
def self.up
|
def up
|
||||||
create_table :system_settings do |t|
|
create_table :system_settings do |t|
|
||||||
t.string :name
|
t.string :name
|
||||||
t.string :label
|
t.string :label
|
||||||
|
@ -162,7 +162,7 @@ A short rundown of some of the major features:
|
||||||
SystemSetting.create :name => "notice", :label => "Use notice?", :value => 1
|
SystemSetting.create :name => "notice", :label => "Use notice?", :value => 1
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.down
|
def down
|
||||||
drop_table :system_settings
|
drop_table :system_settings
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -760,7 +760,7 @@ module ActiveRecord #:nodoc:
|
||||||
# values, eg:
|
# values, eg:
|
||||||
#
|
#
|
||||||
# class CreateJobLevels < ActiveRecord::Migration
|
# class CreateJobLevels < ActiveRecord::Migration
|
||||||
# def self.up
|
# def up
|
||||||
# create_table :job_levels do |t|
|
# create_table :job_levels do |t|
|
||||||
# t.integer :id
|
# t.integer :id
|
||||||
# t.string :name
|
# t.string :name
|
||||||
|
@ -774,7 +774,7 @@ module ActiveRecord #:nodoc:
|
||||||
# end
|
# end
|
||||||
# end
|
# end
|
||||||
#
|
#
|
||||||
# def self.down
|
# def down
|
||||||
# drop_table :job_levels
|
# drop_table :job_levels
|
||||||
# end
|
# end
|
||||||
# end
|
# end
|
||||||
|
|
|
@ -46,13 +46,13 @@ module ActiveRecord
|
||||||
# +change_table+ is actually of this type:
|
# +change_table+ is actually of this type:
|
||||||
#
|
#
|
||||||
# class SomeMigration < ActiveRecord::Migration
|
# class SomeMigration < ActiveRecord::Migration
|
||||||
# def self.up
|
# def up
|
||||||
# create_table :foo do |t|
|
# create_table :foo do |t|
|
||||||
# puts t.class # => "ActiveRecord::ConnectionAdapters::TableDefinition"
|
# puts t.class # => "ActiveRecord::ConnectionAdapters::TableDefinition"
|
||||||
# end
|
# end
|
||||||
# end
|
# end
|
||||||
#
|
#
|
||||||
# def self.down
|
# def down
|
||||||
# ...
|
# ...
|
||||||
# end
|
# end
|
||||||
# end
|
# end
|
||||||
|
@ -479,4 +479,3 @@ module ActiveRecord
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue