migration 1, :create_people_table do
up do
create_table :jobs do
column :id, Integer, :serial => true
column :name, String
end
create_table :people do
column :id, Integer, :serial => true
column :desc, String
column :job_id
end
modify_table :people do
add_foreign_key :job_id, :jobs
end
end
down do
modify_table :people do
drop_foreign_key :jobs
end
end
end
Hi!
I added Foreign Key creation, some examples: