Re: RE: [PEAR] liveuser status
| From: | Markus Wolff | Date: | Fri, 19 Sep 2003 14:32:02 +0000 |
| Subject: | Re: RE: [PEAR] liveuser status | ||
| References: | 1 2 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-21777@lists.php.net to get a copy of this message | ||
Jeroen Houben wrote:
no ON DELETE or ON UPDATE actions. Is that because you think users should decide for themselves what should happen in these cases? [...]
That's probably the SQL files you downloaded from the project site, not the ones in the package or in CVS? You're right, those from the project site do contain foreign keys. And yes, there are no ON statements, because a) I think it's up to the user to decide and b) I for myself usually never use these and require the end-user to clean up his mess before he can delete anything... CASCADE can do way too much damage :-)Stuff like that is database specific. Actually foreign keys only show up in the ERD and not in the sql files.I did see them in the SQL files, just without the ON [action] commands.
I agree that the DBMS should handle integrity, but the admin classes contain this code anyway because we have to keep the mass of users in mind who actually use MySQL with MyISAM tables. Just FYI, MySQL does have a limited support of triggers, meaning you can actually use ON DELETE CASCADE/SET NULL etc. if you use InnoDB tables (maybe it works with BerkeleyDB to... dunno, I don't use it). Unfortunately many people don't even know MySQL can handle foreign keys at all, or think it's too complicated, so it's not being used that often. CU MarkusIf you use our admin interface you don't need to worry about things like that anyways.I guess so, but IMO it's much better to control the data integrity in the RDMBS, that's what it's for. Too bad MySql doesn't support triggers etc. Postgresql users can always add them themselves if they wish to do so.