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