init
This commit is contained in:
25
db/migrate/20150904033833_init.rb
Normal file
25
db/migrate/20150904033833_init.rb
Normal file
@ -0,0 +1,25 @@
|
||||
class Init < ActiveRecord::Migration
|
||||
def up
|
||||
create_table :people do |t|
|
||||
t.string :first_name
|
||||
t.string :last_name
|
||||
t.string :phone
|
||||
t.string :email
|
||||
t.boolean :admin
|
||||
t.boolean :staff
|
||||
end
|
||||
|
||||
create_table :parenthoods do |t|
|
||||
t.integer :person_id
|
||||
t.integer :child_id
|
||||
end
|
||||
|
||||
create_table :children do |t|
|
||||
t.string :first_name
|
||||
t.string :last_name
|
||||
end
|
||||
|
||||
add_index :people, :phone
|
||||
add_index :parenthoods, [:person_id, :child_id], name: 'parentship'
|
||||
end
|
||||
end
|
Reference in New Issue
Block a user