source: de.wigbels.ruby/contact/db/migrate/002_create_contactgroups.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: 408 bytes
RevLine 
[7b7d827]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.