Class: AddUseridToResources
- Inherits:
-
ActiveRecord::Migration
- Object
- ActiveRecord::Migration
- AddUseridToResources
- Defined in:
- lib/generators/templates/add_userid_to_resources.rb
Class Method Summary collapse
Class Method Details
.down ⇒ Object
9 10 11 12 13 14 |
# File 'lib/generators/templates/add_userid_to_resources.rb', line 9 def self.down %w(posts pages).each do |table| remove_column table.to_sym, :author_id remove_column table.to_sym, :last_editor_id end end |
.up ⇒ Object
2 3 4 5 6 7 |
# File 'lib/generators/templates/add_userid_to_resources.rb', line 2 def self.up %w(posts pages).each do |table| add_column table.to_sym, :author_id, :integer add_column table.to_sym, :last_editor_id, :integer end end |