Sha256: 459c16ea2ee37e28cafe54f77fc979336cbce65f5882d95c3a64d0ef2969af6a

Contents?: true

Size: 353 Bytes

Versions: 11

Compression:

Stored size: 353 Bytes

Contents

class CreateLikes < ActiveRecord::Migration
  def change
    create_table :likes do |t|
      t.boolean  :positive, default: true
      t.integer  :target_id
      t.string   :target_type, limit: 60, null: false
      t.integer  :user_id
      t.timestamps
    end
    
    add_index :likes, [:target_id, :user_id, :target_type], unique: true
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
voluntary-0.7.1 db/migrate/20150126185249_create_likes.rb
voluntary-0.7.0 db/migrate/20150126185249_create_likes.rb
voluntary-0.6.0 db/migrate/20150126185249_create_likes.rb
voluntary-0.5.2 db/migrate/20150126185249_create_likes.rb
voluntary-0.5.1 db/migrate/20150126185249_create_likes.rb
voluntary-0.5.0 db/migrate/20150126185249_create_likes.rb
voluntary-0.4.0 db/migrate/20150126185249_create_likes.rb
voluntary-0.3.0 db/migrate/20150126185249_create_likes.rb
voluntary-0.2.4 db/migrate/20150126185249_create_likes.rb
voluntary-0.2.3 db/migrate/20150126185249_create_likes.rb
voluntary-0.2.2 db/migrate/20150126185249_create_likes.rb