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

Cruz, Darwin Darwin.Cruz at gd-ais.com
Wed Feb 6 08:07:10 CST 2008


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



More information about the Solar-talk mailing list