source: de.wigbels.ruby/contact/db/migrate/002_create_contactgroups.rb@ 8f3c501

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

opened projects: hothotwrite and contact

  • Property mode set to 100644
File size: 408 bytes
Line 
1class CreateContactgroups < ActiveRecord::Migration
2 def self.up
3 create_table :contactgroups do |t|
4 t.column :groupname, :string
5 t.column :contact_id, :integer, :null => false
6 end
7
8 execute "alter table contactgroups add constraint fk_contactgroups_contacts
9foreign key (contact_id) references contacts(id)"
10
11 end
12
13 def self.down
14 drop_table :contactgroups
15 end
16end
Note: See TracBrowser for help on using the repository browser.