Sha256: 25784e7c376b60e7326b55d7d6607dadca515aa2c6d393795bed4ae1786f8323

Contents?: true

Size: 516 Bytes

Versions: 4

Compression:

Stored size: 516 Bytes

Contents

class AddUpgradedFromToSpaceShuttles < ActiveRecord::Migration
  def up
    cti_recreate_views_after_change_to('SpaceShuttle') do
      add_column(:space_shuttles, :upgraded_from_id, :integer)
    end
    add_foreign_key :space_shuttles, :space_ships, :column => 'upgraded_from_id'
  end

  def down
    cti_recreate_views_after_change_to('SpaceShuttle') do
      remove_column(:space_shuttles, :upgraded_from_id)
    end
    remove_foreign_key :space_shuttles, :space_ships, :column => 'upgraded_from_id'
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
dbview_cti-0.2.2 spec/dummy-rails-3/db/migrate/20140411001620_add_upgraded_from_to_space_shuttles.rb
dbview_cti-0.2.1 spec/dummy-rails-3/db/migrate/20140411001620_add_upgraded_from_to_space_shuttles.rb
dbview_cti-0.2.0 spec/dummy-rails-3/db/migrate/20140411001620_add_upgraded_from_to_space_shuttles.rb
dbview_cti-0.1.5 spec/dummy-rails-3/db/migrate/20140411001620_add_upgraded_from_to_space_shuttles.rb