Sha256: 33f94ada18195d7fb23de5c6136bf9a0a6d3a7f9e2c7434d3bd1528b3b702729

Contents?: true

Size: 442 Bytes

Versions: 8

Compression:

Stored size: 442 Bytes

Contents

class RenameReferrerIdForeignKeyColumn < ActiveRecord::Migration
  def up
    remove_index  :astrochimp_signups, :referral_id
    rename_column :astrochimp_signups, :referral_id, :referrer_id
    add_index     :astrochimp_signups, :referrer_id
  end

  def down
    remove_index  :astrochimp_signups, :referrer_id
    rename_column :astrochimp_signups, :referrer_id, :referral_id
    add_index     :astrochimp_signups, :referral_id
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
astrochimp-0.2.5 db/migrate/20121207033108_rename_referrer_id_foreign_key_column.rb
astrochimp-0.2.4 db/migrate/20121207033108_rename_referrer_id_foreign_key_column.rb
astrochimp-0.2.3 db/migrate/20121207033108_rename_referrer_id_foreign_key_column.rb
astrochimp-0.2.2 db/migrate/20121207033108_rename_referrer_id_foreign_key_column.rb
astrochimp-0.2.1 db/migrate/20121207033108_rename_referrer_id_foreign_key_column.rb
astrochimp-0.2.0 db/migrate/20121207033108_rename_referrer_id_foreign_key_column.rb
astrochimp-0.1.3 db/migrate/20121207033108_rename_referrer_id_foreign_key_column.rb
astrochimp-0.1.2 db/migrate/20121207033108_rename_referrer_id_foreign_key_column.rb