Sha256: b08e834c64d9cd0616b970d7bd06ff5d769f7a25f201d8c935240d4914809525

Contents?: true

Size: 214 Bytes

Versions: 4

Compression:

Stored size: 214 Bytes

Contents

class AddReferences < ActiveRecord::Migration
  def up
    add_foreign_key(:books, :users, :column => 'user_id')
  end

  def down
    change_table :books do |t|
      t.remove_foreign_key :users
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
rails3_pg_deferred_constraints-0.1.0 test/dummy/db/migrate/20110909072642_add_references.rb
rails3_pg_deferred_constraints-0.0.4 test/dummy/db/migrate/20110909072642_add_references.rb
rails3_pg_deferred_constraints-0.0.3 test/dummy/db/migrate/20110909072642_add_references.rb
rails3_pg_deferred_constraints-0.0.2 test/dummy/db/migrate/20110909072642_add_references.rb