Sha256: 790e579e4d8cf2816e7ad2f2ea55d18149d7f5cf06cd169a18d9b5e6f0f405f7

Contents?: true

Size: 723 Bytes

Versions: 1

Compression:

Stored size: 723 Bytes

Contents

class CreateCommentsTable < ActiveRecord::Migration
  def self.up
    create_table :comments, :force => true do |t|
      t.string :commentable_type
      t.integer :commentable_id
      t.integer :user_id
      t.text :comment
      t.string :unauthenticated_name
      t.string :unauthenticated_email
      t.string :unauthenticated_website
      t.string :ip_address
      t.string :session_hash
      t.string :browser_fingerprint      
      t.timestamps
    end    
    add_index :comments, [:commentable_type, :commentable_id, :ip_address, :browser_fingerprint], :name => "comments_index", :unique => false
  end

  def self.down
    remove_index :comments, :name=> :comments_index
    drop_table :comments
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
social_engine-0.0.1 lib/generators/social_engine/install/templates/create_comments_table.rb