Re: Liveuser tables
| From: | Jeroen Houben | Date: | Mon, 29 Aug 2005 14:23:20 +0000 |
| Subject: | Re: Liveuser tables | ||
| References: | 1 2 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-20630@lists.php.net to get a copy of this message | ||
Lukas Smith wrote:
Jeroen Houben wrote: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? I guess I could also just use my user information table directly within LU by creating mappings but I'd rather keep them seperated.- No foreign keys seem to have been created in my postgresql DB, is that correct?yes .. unfortunately MDB2_Schema does not yet handle foreign keys.
Okay great.- In the users table why is authuserid a varchar?because the default type for the auth user id field is "text" you can change this default by passing in a new mapping inside the storage configuration .. ['storage']['fields']['auth_user_id'] = 'integer' then it will be created as an integer instead of a varchar- Why is the max length of the handle only 32? This can easily become a problem if you use an email address as a handle..this is a limitation of the structure definition. it does not support length, therefore the installer default to length 32. this is a fairly random setting indeed. of course you can overwrite it! there is a third optional array parameter you can pass to generateSchema(). in it you can pass a key value mapping where key is the name of the column and the value the length. for example: array('handle' => 100);
Okay okay you got me :-) This is a nice feature indeed. Many thanks again! Jeroen- Maybe it would be better to rename authuserid in the users table to auth_user_id in the perm_users table..this is entirely in your control. you may not have been aware of this, but you actually aliased the "auth_user_id" column in the auth container to "authUserId". look at your configuration array and I am sure you will find out where you do this :-)