# Scaffold and foreign keys

**URL:** <https://www.ruby-forum.com/t/scaffold-and-foreign-keys/105221>\
**Category:** Rails\
**Created:** [May 27, 2007, 4:13pm UTC](https://www.ruby-forum.com/t/scaffold-and-foreign-keys/105221 "2007-05-27T16:13:22Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![phirefly](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/e9a140/32.png) [@phirefly](https://www.ruby-forum.com/u/phirefly)\
**Post date:** [May 27, 2007, 4:13pm UTC](https://www.ruby-forum.com/t/scaffold-and-foreign-keys/105221/1 "2007-05-27T16:13:22Z")

</div>

Hello,  
I create a migration to add a foreign key ‘page\_id’ to a table  
‘main\_sections’. After running the migration and adding the column,  
the scaffol that I have on the main\_setions table does not add the  
foreign key into the CRUD.

Any ideas why this is the case?

Thanks.
