Sha256: c0c69ed01e3cd963fa76f594226f554a3bfe4ae0faa4090ff8068017199122cb

Contents?: true

Size: 722 Bytes

Versions: 16

Compression:

Stored size: 722 Bytes

Contents

class CreateSocialNetworkingLikes < ActiveRecord::Migration
  def change
    create_table :social_networking_likes do |t|
      t.integer :participant_id, null: false
      t.integer :item_id, null: false
      t.string :item_type, null: false

      t.timestamps
    end

    reversible do |dir|
      dir.up do
        execute <<-SQL
          ALTER TABLE social_networking_likes
            ADD CONSTRAINT fk_likes_participants
            FOREIGN KEY (participant_id)
            REFERENCES participants(id)
        SQL
      end

      dir.down do
        execute <<-SQL
          ALTER TABLE social_networking_likes
            DROP CONSTRAINT IF EXISTS fk_likes_participants
        SQL
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
social_networking-0.13.3 db/migrate/20140827154939_create_social_networking_likes.rb
social_networking-0.13.2 db/migrate/20140827154939_create_social_networking_likes.rb
social_networking-0.13.1 db/migrate/20140827154939_create_social_networking_likes.rb
social_networking-0.13.0 db/migrate/20140827154939_create_social_networking_likes.rb
social_networking-0.12.0 db/migrate/20140827154939_create_social_networking_likes.rb
social_networking-0.11.8 db/migrate/20140827154939_create_social_networking_likes.rb
social_networking-0.11.7 db/migrate/20140827154939_create_social_networking_likes.rb
social_networking-0.11.6 db/migrate/20140827154939_create_social_networking_likes.rb
social_networking-0.11.5 db/migrate/20140827154939_create_social_networking_likes.rb
social_networking-0.11.4 db/migrate/20140827154939_create_social_networking_likes.rb
social_networking-0.11.3 db/migrate/20140827154939_create_social_networking_likes.rb
social_networking-0.11.2 db/migrate/20140827154939_create_social_networking_likes.rb
social_networking-0.11.1 db/migrate/20140827154939_create_social_networking_likes.rb
social_networking-0.11.0 db/migrate/20140827154939_create_social_networking_likes.rb
social_networking-0.10.0 db/migrate/20140827154939_create_social_networking_likes.rb
social_networking-0.9.3 db/migrate/20140827154939_create_social_networking_likes.rb