Sha256: ee51cc3b18777fe1069e1f690b53631726277ee20c0b0c4b95dba2a8e2d7fb61

Contents?: true

Size: 774 Bytes

Versions: 16

Compression:

Stored size: 774 Bytes

Contents

class CreateSocialNetworkingComments < ActiveRecord::Migration
  def change
    create_table :social_networking_comments do |t|
      t.integer :participant_id, null: false
      t.string :text, 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_comments
            ADD CONSTRAINT fk_comments_participants
            FOREIGN KEY (participant_id)
            REFERENCES participants(id)
        SQL
      end

      dir.down do
        execute <<-SQL
          ALTER TABLE social_networking_comments
            DROP CONSTRAINT IF EXISTS fk_comments_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/20140827154953_create_social_networking_comments.rb
social_networking-0.13.2 db/migrate/20140827154953_create_social_networking_comments.rb
social_networking-0.13.1 db/migrate/20140827154953_create_social_networking_comments.rb
social_networking-0.13.0 db/migrate/20140827154953_create_social_networking_comments.rb
social_networking-0.12.0 db/migrate/20140827154953_create_social_networking_comments.rb
social_networking-0.11.8 db/migrate/20140827154953_create_social_networking_comments.rb
social_networking-0.11.7 db/migrate/20140827154953_create_social_networking_comments.rb
social_networking-0.11.6 db/migrate/20140827154953_create_social_networking_comments.rb
social_networking-0.11.5 db/migrate/20140827154953_create_social_networking_comments.rb
social_networking-0.11.4 db/migrate/20140827154953_create_social_networking_comments.rb
social_networking-0.11.3 db/migrate/20140827154953_create_social_networking_comments.rb
social_networking-0.11.2 db/migrate/20140827154953_create_social_networking_comments.rb
social_networking-0.11.1 db/migrate/20140827154953_create_social_networking_comments.rb
social_networking-0.11.0 db/migrate/20140827154953_create_social_networking_comments.rb
social_networking-0.10.0 db/migrate/20140827154953_create_social_networking_comments.rb
social_networking-0.9.3 db/migrate/20140827154953_create_social_networking_comments.rb