[Solar-talk] Question about Using SolarModels to defin tables

Raymond Kolbe rkolbe at gmail.com
Wed Feb 6 08:32:06 CST 2008


No, there is not a way to do this. I looked into this a while back. I would
suggest not relying on Solar to create your tables/cols unless you intend to
use a very simple setup. I do not know if support for advanced features at
the database abstraction layer is in the works or being thought of.

I have spent a great amount of time in Solar_Sql_Model and
Solar_Sql_Model_Record which is what I deal with all of the time (no real
need to dive into Solar_Sql). If you study these couple of classes you will
realize that auto creation is limited.

--Raymond K.

On Feb 6, 2008 9:07 AM, Cruz, Darwin <Darwin.Cruz at gd-ais.com> wrote:

> Hmm, I'm not sure what foreign means, so I can't answer this one. :)
>
>
>  Is it possible to define a column as foreign keys to another table?  I
>  know that you can use the $this->_hasMany... example to link up
>  relationships but it doesn't specifically create the foreign key
>  constraint against the database.
>
> There i fixored it :D.  So is it possible to define a foreign key
> constraint on the database through the model?
>
>
> -----Original Message-----
> From: solar-talk-bounces at lists.solarphp.com
> [mailto:solar-talk-bounces at lists.solarphp.com] On Behalf Of Rodrigo
> Moraes
> Sent: Wednesday, February 06, 2008 8:58 AM
> To: solar-talk at lists.solarphp.com
> Subject: Re: [Solar-talk] Question about Using SolarModels to defin
> tables
>
> On Feb 6, 2008 11:51 AM, Rodrigo Moraes wrote:
> > > Is it possible to set up on delete/update cascade, restrict, etc
> > > rules on the tables?
> >
> > Not automatically. You can do this manually using Solar_Sql and SQL
> > queries inside your model, though.
>
> Ah, forgot this: there're some hooks in the records for preSave() /
> postSave() / preDelete() / etc. Not the same as setting rules in the
> database itself, but maybe can help. To add rules in the database, you
> should use plain SQL.
>
> -- rodrigo
> _______________________________________________
> Solar-talk mailing list
> Solar-talk at lists.solarphp.com
> http://mailman-mail3.webfaction.com/listinfo/solar-talk
>
> _______________________________________________
> Solar-talk mailing list
> Solar-talk at lists.solarphp.com
> http://mailman-mail3.webfaction.com/listinfo/solar-talk
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman-mail3.webfaction.com/pipermail/solar-talk/attachments/20080206/ebea5c45/attachment.html


More information about the Solar-talk mailing list