Sha256: 36c673993a7a42137e249da3d657d88af0cac2a4fbcf05f471671ee944bc15dc

Contents?: true

Size: 498 Bytes

Versions: 18

Compression:

Stored size: 498 Bytes

Contents

class CreateComments < ActiveRecord::Migration
  def self.up
    create_table :comments do |t|
      t.string :title, :limit => 50, :default => "" 
      t.text :comment
      t.references :commentable, :polymorphic => true
      t.references :user
      t.string :role, :default => "comments"
      t.timestamps
    end

    add_index :comments, :commentable_type
    add_index :comments, :commentable_id
    add_index :comments, :user_id
  end

  def self.down
    drop_table :comments
  end
end

Version data entries

18 entries across 18 versions & 2 rubygems

Version Path
commenteux-1.2.0 spec/dummy/db/migrate/20140312000846_create_comments.rb
commenteux-1.1.6 spec/dummy/db/migrate/20140312000846_create_comments.rb
commenteux-1.1.5 spec/dummy/db/migrate/20140312000846_create_comments.rb
commenteux-1.1.4 spec/dummy/db/migrate/20140312000846_create_comments.rb
commenteux-1.1.3 spec/dummy/db/migrate/20140312000846_create_comments.rb
acts_as_commentable-4.0.2 lib/generators/comment/templates/create_comments.rb
commenteux-1.1.2 spec/dummy/db/migrate/20140312000846_create_comments.rb
commenteux-1.1.1 spec/dummy/db/migrate/20140312000846_create_comments.rb
commenteux-1.1.0 spec/dummy/db/migrate/20140312000846_create_comments.rb
commenteux-1.0.6 spec/dummy/db/migrate/20140312000846_create_comments.rb
commenteux-1.0.5 spec/dummy/db/migrate/20140312000846_create_comments.rb
commenteux-1.0.4 spec/dummy/db/migrate/20140312000846_create_comments.rb
commenteux-1.0.3 spec/dummy/db/migrate/20140312000846_create_comments.rb
commenteux-1.0.2 spec/dummy/db/migrate/20140312000846_create_comments.rb
commenteux-1.0.1 spec/dummy/db/migrate/20140312000846_create_comments.rb
commenteux-1.0.0 spec/dummy/db/migrate/20140312000846_create_comments.rb
acts_as_commentable-4.0.1 lib/generators/comment/templates/create_comments.rb
acts_as_commentable-4.0.0 lib/generators/comment/templates/create_comments.rb