api/db/migrate/20160127204700_create_goals.rb
class CreateGoals < ActiveRecord::Migration[5.1]
def change
create_table :goals do |t|
t.index :id
t.string :name, default: ''
t.string :photo_url
t.integer :target
t.integer :current
t.integer :user_id, index: true
t.integer :child_id, index: true
t.datetime :deleted_at
t.timestamps null: false
end
add_foreign_key :goals, :users
add_foreign_key :goals, :children
end
end