source: de.wigbels.ruby/contact/db/migrate/003_change_reference_contact_contactgroup.rb@ 718846a

Last change on this file since 718846a was 7b7d827, checked in by njw <njw@…>, 11 years ago

opened projects: hothotwrite and contact

  • Property mode set to 100644
File size: 529 bytes
Line 
1class ChangeReferenceContactContactgroup < ActiveRecord::Migration
2 def self.up
3 # move the reference between contacts..contactgroups the other way round
4 execute "alter table contactgroups drop foreign key fk_contactgroups_contacts"
5 remove_column :contactgroups, :contact_id
6
7 add_column :contacts, :contactgroup_id, :integer, :null => false
8 execute "alter table contacts add constraint fk_contacts_contactgroups foreign key (contactgroup_id) references contactgroups(id)"
9 end
10
11 def self.down
12 end
13end
Note: See TracBrowser for help on using the repository browser.