Re: DataObject: Ignoring key definitions
| From: | Alan Knowles | Date: | Thu, 20 Nov 2003 05:58:28 +0000 |
| Subject: | Re: DataObject: Ignoring key definitions | ||
| References: | 1 | Groups: | php.pear.general php.pear.general |
| Request: | Send a blank email to pear-general+get-9046@lists.php.net to get a copy of this message | ||
I will look at this in the next few days - the whole sequence/key code is very complex and needs desperatly simplifying...
It may involve an overhall of the keys code:
[crosstable__keys] table1_id = 2 == recognized autoincrement or nextval key table2_id = 1 == normal primary key or unique'sin which case : - insert should use autoinc keys.. - update/delete should use any of them which are set.. if the generator fails to guess the autoincrement, then overriding the keys() method is the prefered way to fix this (no more ignore_sequence_keys etc...) I may also introduce realdbtype = mssql so you can use the identiy code with odbc Thoughts..... Regards Alan Markus Wolff wrote:
Hi there, I got a classic cross-linking table in my database looking like this: - table1_id: part of primary key and also foreign key to table1 - table2_id: part of primary key and also foreign key to table2 In my database.ini, this will write the following entries: [crosstable__keys] table1_id = 1 table2_id = 1 Problem is, when I do an INSERT on this table, table1_id will be treated as an auto_increment primary key and will not be included in the INSERT statement. I tried to solve this in the config file using: ignore_sequence_keys = crosstable Didn't work. Then I tried to go into the crosstable class and redefine the keys() method: function keys() {-- Can you help out? Need Consulting Services or Know of a Job? http://www.akbkhome.comreturn array();} No success either. The only thing that helped was uncommenting the key definitions from the config file - but this will of course be overwritten on the next createTables run. I must admit I haven't tried the latest package release yet - is this a known bug or are there other workarounds that I've missed? CU Markus