Class: CreateParticipants

Inherits:
ActiveRecord::Migration
  • Object
show all
Defined in:
lib/generators/reso/templates/create_participants.rb

Instance Method Summary collapse

Instance Method Details

#changeObject



2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/generators/reso/templates/create_participants.rb', line 2

def change
  create_table :participants, options: 'DEFAULT CHARSET=utf8' do |t|
    t.string :participant_key
    t.string :participant_identifier
    t.string :participant_code
    t.string :first_name
    t.string :last_name
    t.references :person, index:true, foreign_key: true
    t.references :participant_role, index: true
    t.string :primary_contact_phone
    t.string :office_phone
    t.string :mobile_phone
    t.string :email
    t.string :fax 
    t.string :website_url
    t.string :photo_url

    t.timestamps
  end
  add_index :participants, :email
  add_index :participants, :participant_identifier
  add_index :participants, :participant_key
  add_index :participants, [:first_name, :last_name, :email]
end