[Solar-talk] sql_model auto-create

devsmt devsmt at gmail.com
Sat Feb 10 09:55:32 PST 2007


Paul M Jones:
> Hi Jeff,
>
>   
>> Have been playing with the new sql_model stuff, and guess what? I  
>> cant make it
>> auto create a table if it does not exist, whats new with me! :-)
>>     
Hi all,

I wold like to understand how will be the workflow to define a new table...

my approach is, after having decided the need for a new table, go on the
db admin tool and define it.
than define or update my php stuff accordingly.
actually i use a script that generates a cached setup(this way, model
doesn't look for defaults at runtime) reading mysql metadata,  the
definitions i do manually are never touched and override defaults
generated by that script.
after a change in the db schema i run the script to resync the php setup.

if the workflow goes from php definition to db, if i need to change some
field, i have to change db and php model, if i misspell a php definition
it results in pollution of the underlying db...

i decided for my system to not have a table auto create at all,
enforcing the db priority over the php app, using it as the real
"configuration" as i don't see reasons to have a duplicate schema to
maintain.

let me know what you think







More information about the solar-talk mailing list