# Newbie question on adding columns and references to existing table

**URL:** <https://www.ruby-forum.com/t/newbie-question-on-adding-columns-and-references-to-existing-table/162601>\
**Category:** Rails\
**Created:** [March 11, 2009, 7:08pm UTC](https://www.ruby-forum.com/t/newbie-question-on-adding-columns-and-references-to-existing-table/162601 "2009-03-11T19:08:36Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![tappind](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/7ab992/32.png) [@tappind](https://www.ruby-forum.com/u/tappind)\
**Post date:** [March 11, 2009, 7:08pm UTC](https://www.ruby-forum.com/t/newbie-question-on-adding-columns-and-references-to-existing-table/162601/1 "2009-03-11T19:08:36Z")

</div>

I took a run at the blog tutorial and now I am working on my first  
Ruby app. I have two models with the same relationship as the post /  
comments example in the blog tutorial.

When I created the second model I forgot to add the ‘reference’ column  
to link the two together.

I can’t seem to find anywhere the correct way to fix this and in  
general to add columns to an existing database table.

Thanks,

Dan

---

<div class="post-metadata">

**Author:** ![tappind](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/7ab992/32.png) [@tappind](https://www.ruby-forum.com/u/tappind)\
**Post date:** [March 11, 2009, 7:13pm UTC](https://www.ruby-forum.com/t/newbie-question-on-adding-columns-and-references-to-existing-table/162601/2 "2009-03-11T19:13:17Z")

</div>

Migrations. Look into migrations. You can add, remove, change, etc.  
columns and anything in the database through migrations.
