Forum: Ruby on Rails Manage of dynamic tables.

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
B534ca44be2dfdef03f4eaccbb56fb81?d=identicon&s=25 Neshumah (Guest)
on 2007-05-20 00:52
(Received via mailing list)
Hi group,

Im new at here and I hope someone could give me a hand, im building an
app witch is going to manage big amount of contacts, but my problem is
that I need to accept a variety of columns from my customers, so i was
planning to do this:

Have a table named Lists on witch I would manage some other tables
that I would built dynamically respecting the user data, so if an user
want to upload a csv with 6 columns, I create a table with arbitrary
random name with 6 columns plus my control columns.
So schema looks like:

Lists > id, company_id, name, table_name (this would be my dynamically
created table name)

My dynamic tables would have, I already have a datatype parser for
colums data type definition.
Table# > id, email, creation_date, column1, column2, column3.....
columnN

My problem with this schema is that I don't know how to manage
dynamically created tables. If you could give me a hand or some
ideas,  I appreciate it.

Thanks very much
B534ca44be2dfdef03f4eaccbb56fb81?d=identicon&s=25 Neshumah (Guest)
on 2007-05-20 01:54
(Received via mailing list)
Or maybe some other way to get this done ?
 Thanks very much
C4555f59207b79749c0969022551bb1f?d=identicon&s=25 Branko Wi (branko)
on 2007-05-20 17:03
Neshumah wrote:
> Or maybe some other way to get this done ?
>  Thanks very much

To be honest I do not see the value of this is the way you explain, why
not create a table for all contacts, where you have a lot of different
fields, for all the contacts, so that you will have several values in
your table which are not filled out.
If you want to have a variable number of phonenumbers, emails or
webpages, then you could consider setting up another table with a 1 to n
relationship...

Hope this helps,

Branko
This topic is locked and can not be replied to.