# Create a table per user

**URL:** <https://www.ruby-forum.com/t/create-a-table-per-user/164036>\
**Category:** Rails\
**Created:** [March 27, 2009, 7:01am UTC](https://www.ruby-forum.com/t/create-a-table-per-user/164036 "2009-03-27T07:01:17Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![miki](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/df788c/32.png) [@miki](https://www.ruby-forum.com/u/miki)\
**Post date:** [March 27, 2009, 7:01am UTC](https://www.ruby-forum.com/t/create-a-table-per-user/164036/1 "2009-03-27T07:01:17Z")

</div>

not sure what to look at…  
how would i go about creating tables within the application? i have my  
users and say, for each one i want to create another table(s) when they  
register, that would be customized to them and accessible only by them?

miki

---

<div class="post-metadata">

**Author:** ![miki](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/df788c/32.png) [@miki](https://www.ruby-forum.com/u/miki)\
**Post date:** [March 27, 2009, 7:57am UTC](https://www.ruby-forum.com/t/create-a-table-per-user/164036/2 "2009-03-27T07:57:55Z")

</div>

On 27 Mar., 07:01, Silviu M. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> not sure what to look at…  
> how would i go about creating tables within the application? i have my  
> users and say, for each one i want to create another table(s) when they  
> register, that would be customized to them and accessible only by them?

That kind of thing should never ever be done. Imagine when you reach,  
maybe, a thousand users, you’ll have at least thousand tables! Then  
imagine when you need to make a change in the users’ tables! I  
strongly recommend to make use of Rails’ has\_many and belongs\_to  
associations to keep track of which records belongs to which users,  
instead.

–  
Best regards,  
David K.  
[http://twitter.com/rubyguy](http://twitter.com/rubyguy)
