logo       

DataObject: Ignoring key definitions: msg#00331

php.pear.general

Subject: DataObject: Ignoring key definitions

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()
{
return 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

--
PEAR General Mailing List (http://pear.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise