# Relationships

**URL:** <https://www.ruby-forum.com/t/relationships/91259>\
**Category:** Deployment\
**Created:** [April 6, 2007, 2:42am UTC](https://www.ruby-forum.com/t/relationships/91259 "2007-04-06T02:42:23Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shanon](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/48db29/32.png) [@Shanon](https://www.ruby-forum.com/u/Shanon)\
**Post date:** [April 6, 2007, 2:42am UTC](https://www.ruby-forum.com/t/relationships/91259/1 "2007-04-06T02:42:23Z")

</div>

How does one setup relations between table

I have the has\_many and belongs\_to in the correct places (hopefully) but  
i think i have the migrations in the incorrect order

A user can create many jobs  
so i have

user has\_many jobs  
and jobs belongs\_to user

however i have the migration that creates the job table before i have  
the migration that creates the user table can i still get this to work  
and if not,  
How does one change the order of the migration with deleting the first  
one and creating it again

and does the migration need to have t.column user\_id, :int or will this  
be added automatically
