>>> ALTER TABLE `PortInnerInterface` ADD UNIQUE (`default_oif_id` ); >> This is wrong. In practice the same OIF may be default for several IIFs >> (e.g. 10GBase-SR for SFP+ and XFP). > > Did you mean "PortInterfaceCompat" ? my PortInnerInterface looks like this: > > mysql> select * from PortInnerInterface; > +----+-----------+----------------+ > | id | iif_name | default_oif_id | > +----+-----------+----------------+ > | 1 | hardwired | 24 | > | 2 | SFP-100 | 1208 | > | 3 | GBIC | 1078 | > | 4 | SFP-1000 | 1077 | > | 5 | XENPAK | 1079 | > | 6 | X2 | 1080 | > | 7 | XPAK | 1081 | > | 8 | XFP | 1082 | > | 9 | SFP+ | 1084 | > | 10 | SFP-1GFC | 50440 | > | 11 | SFP-2GFC | 50431 | > | 12 | SFP-4GFC | 50430 | > +----+-----------+----------------+ > 12 rows in set (0.00 sec) > > mysql> I mean exactly PortInnerInterface. Imagine this set of data: | 5 | XENPAK | 30 | | 6 | X2 | 30 | | 7 | XPAK | 30 | | 8 | XFP | 30 | | 9 | SFP+ | 30 | The current meaning of DEFAULT_PORT_OIF_IDS is to control, which outer interface is assumed by default for each inner interface. There is no restriction for default OIF to be unique. [...] > Ups my fault ... i changed Dictionary to InnoDB on my dev VM. > >> This won't work, because Dictionary is normally MyISAM (this blocks >> several other foreign keys as well). It is likely to finally become >> InnoDB in next releases, but now it is MyISAM. > > :-) > > When updating could you remove the "NOT NULL" from Dictionary.chapter_id > and Dictionary.dict_key and insert > (0,0,default) to be amle to refference optional attributes ? I am not sure I get this right. What would this be used for? P.S. I will review the patch to PHP code later this week. -- Denis Ovsienko