Sha256: 909921abea34938e8712e87e59cf305320827d679250c2cddcc19dc328835500

Contents?: true

Size: 411 Bytes

Versions: 1

Compression:

Stored size: 411 Bytes

Contents

class CreateLikes < ActiveRecord::Migration[6.0]
  def change
    create_table :likes do |t|
      t.string  :liker_type
      t.integer :liker_id
      t.string  :likeable_type
      t.integer :likeable_id
      t.datetime :created_at
    end

    add_index :likes, ["liker_id", "liker_type"],       :name => "fk_likes"
    add_index :likes, ["likeable_id", "likeable_type"], :name => "fk_likeables"
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
socialization-2.0.2 lib/generators/socialization/templates/active_record/migration_likes.rb