This commit is contained in:
2015-09-12 15:37:05 -05:00
commit cb7e47a466
77 changed files with 1374 additions and 0 deletions

View 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

7
db/seeds.rb Normal file
View File

@ -0,0 +1,7 @@
# This file should contain all the record creation needed to seed the database with its default values.
# The data can then be loaded with the rake db:seed (or created alongside the db with db:setup).
#
# Examples:
#
# cities = City.create([{ name: 'Chicago' }, { name: 'Copenhagen' }])
# Mayor.create(name: 'Emanuel', city: cities.first)