carmen wrote:
… im not convinced modifying tables in realtime, per user request, is the
most efficient way to go about things (although you could fire off
migrations from a controller, if you want a wild rodeo going on in your
schema). you might want to use something like ActiveRDF instead of
ActiveRecord, so you can use a store which is more open to run-time
extensibility. or try to figure out a generalized schema that doesn’t
require continual migrations and layer some (meta)programming logic on
top…
I thought about other ways. E.g., program lets me make tables, all have
id, title, description. others have other attributes added to a query
by a left join (each attribute). so
LIST_OF_LISTS
id
list_name
LIST_COLUMN_HEADINGS
list_id
list_item_title (column heading)
list_item_type (vc or date – below)
TABLES
id
title
description
TABLE_ATTRIBUTE_LINK_VARCHAR (I need only vc255)
table_id
list_id
additional_attribute_value
TABLE_ATTRIBUTE_LINK_DATE (for all date attributes)
table_id
list_id
additional_attribute_value
A list might be generated like this:
For a particular list, which has an id X,
- first get the list column headers by searching LIST_C_H
- the result set will be the columns
- then use those to construct a query for rows
- select from table where list_id is X
- programmatically (using scripting language like php/rails/whatever)
… add a join for each attribute
… joining from either vc or date depending on the attribute.
- then limit to cull null rows
In effect, i might get something like this (assume three attibutes)
List: Songs (list_id 1)
+ID—Title—Descr—Date----Artist-----Label—+
! 1 I know Good 1/1/06 Team Band garage !
±-----------------------------------------------+
Date comes from a row in T_A_L_D
Artist comes from a row in T_A_L_V
So does label
I’d like a better way, but I have made this work.