Re: Liveuser tables
| From: | Lukas Smith | Date: | Mon, 29 Aug 2005 14:29:38 +0000 |
| Subject: | Re: Liveuser tables | ||
| References: | 1 2 3 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-20631@lists.php.net to get a copy of this message | ||
Jeroen Houben wrote:
Yes, the admin classes try to ensure that all relevant information is removed. IIRC the only exception is when you use the optional liveuser_translation tables.yes .. unfortunately MDB2_Schema does not yet handle foreign keys.So all related entries in foreign tables are deleted by LU code then?
Let's assume I have another table (outside the LU spectrum) with user information, such as address, phone number etc. In this table I also have an email field which I want to use as the handle in the LU tables. Can I create my own foreign keys that deletes a user from the users/permissions/groups tables once an entry is updated/deleted from my own user table? Ideally I would like to also create a trigger that inserts a new users (set to inactive) into the perm_users table every time a new persons is inserted into my user user table. I'm just wondering if all this will survive future upgrades or will I have to re-create these additions when I upgrade?It should. The XML schema files as you seem to be aware can also handle updates. However the MDB2_Schema class is unaware of any changes you may have made in the database itself. As such on update it will only attempt to do the changes it detects between two different xml schema files. So as long as you dont rename a table (which would lead to dropping the existing table and creating a new one) or change a column with a foreign key everything should be ok.
I guess I could also just use my user information table directly within LU by creating mappings but I'd rather keep them seperated.Well this is getting to the limits of the LU installer. One day the MDB2_Schema manager will support foreign keys. Until then you just have to make sure that nothing breaks before/after an update. regards, Lukas PS: if you feel motivated you can provide a patch against the current docbook dokumentation .. or just provide some addition plain text information about the information you are aquiring on LiveUser installation.