Sha256: 05bdb0f7e9001f82c16e601f4001ec358fa50b7cb68e052b4312f843c6efcfcf

Contents?: true

Size: 409 Bytes

Versions: 1

Compression:

Stored size: 409 Bytes

Contents

class AddParole < ActiveRecord::Migration
  def self.up
    create_table :comments do |t|
      t.references :commentable, polymorphic: true
      t.references :commenter, polymorphic: true
      t.string :role, default: 'comment'
      t.text :comment

      t.timestamps
    end

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

  def self.down
    drop_table :comments
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
parole-0.1 lib/generators/parole/templates/migration.rb