class AddParole

Public Class Methods

down() click to toggle source
# File lib/generators/parole/templates/migration.rb, line 16
def self.down
  drop_table :comments
end
up() click to toggle source
# File lib/generators/parole/templates/migration.rb, line 2
def self.up
  create_table :comments do |t|
    t.references :commentable, polymorphic: true
    t.references :commenter, polymorphic: true
    t.string :role
    t.text :comment

    t.timestamps
  end

  add_index :comments, [:commentable_type, :commentable_id, :role]
  add_index :comments, [:commentable_type, :commentable_id]
end