Sha256: 1ff1d44a8fc2392c0353d372067bc59a00bcb13b8a67d19fe8d6e9a11650109c

Contents?: true

Size: 644 Bytes

Versions: 5

Compression:

Stored size: 644 Bytes

Contents

class AddArmIdToBitCoreSlideshows < ActiveRecord::Migration
  def change
    add_column :bit_core_slideshows, :arm_id, :integer, null: false

    reversible do |dir|
      dir.up do
        # add foreign key constaint
        execute <<-SQL
          ALTER TABLE bit_core_slideshows
            ADD CONSTRAINT fk_bit_core_slideshows_arms
            FOREIGN KEY (arm_id)
            REFERENCES arms(id)
        SQL
      end

      dir.down do
        # remove foreign key constaint
        execute <<-SQL
          ALTER TABLE bit_core_slideshows
            DROP CONSTRAINT fk_bit_core_slideshows_arms
        SQL
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
bit_core-1.4.7 db/migrate/20141205202724_add_arm_id_to_bit_core_slideshows.rb
bit_core-2.0.0.beta2 db/migrate/20141205202724_add_arm_id_to_bit_core_slideshows.rb
bit_core-2.0.0.beta1 db/migrate/20141205202724_add_arm_id_to_bit_core_slideshows.rb
bit_core-1.4.6 db/migrate/20141205202724_add_arm_id_to_bit_core_slideshows.rb
bit_core-1.4.5 db/migrate/20141205202724_add_arm_id_to_bit_core_slideshows.rb