[racktables-users] Re: DEFAULT_PORT_OIF_IDS

  • From: Manon Goo <lists@xxxxxxxx>
  • To: racktables-users@xxxxxxxxxxxxx
  • Date: Sun, 31 Jul 2011 20:11:58 +0200

Hi  Denis Ovsienko

Could take look at my ptach ?

Cheers,
Manon


DDL:

ALTER TABLE `PortInnerInterface` ADD `default_oif_id` INT(10 ) UNSIGNED NOT NULL ;
ALTER TABLE `PortInnerInterface` ADD UNIQUE (`default_oif_id` );
UPDATE PortInnerInterface SET  default_oif_id= 24 WHERE id=1;
UPDATE PortInnerInterface SET  default_oif_id= 1077 WHERE id=4;
UPDATE PortInnerInterface SET  default_oif_id= 1078 WHERE id=3;
UPDATE PortInnerInterface SET  default_oif_id= 1079 WHERE id=5;
UPDATE PortInnerInterface SET  default_oif_id= 1080 WHERE id=6;
UPDATE PortInnerInterface SET  default_oif_id= 1081 WHERE id=7;
UPDATE PortInnerInterface SET  default_oif_id= 1082 WHERE id=8;
UPDATE PortInnerInterface SET  default_oif_id= 1084 WHERE id=9;

// my local stuff
UPDATE PortInnerInterface SET  default_oif_id= 1208 WHERE id=2;
UPDATE PortInnerInterface SET  default_oif_id= 50430 WHERE id=12;
UPDATE PortInnerInterface SET  default_oif_id= 50431 WHERE id=11;
UPDATE PortInnerInterface SET  oif_id= 50440 WHERE id=10;
ALTER TABLE PortInnerInterface ADD CONSTRAINT `PortInnerInterface-FK-default_oif_id` FOREIGN KEY (`default_oif_id`) REFERENCES `Dictionary` (`dict_key`) ON DELETE CASCADE;



--On 31. Juli 2011 20:06:08 +0400 Denis Ovsienko <infrastation@xxxxxxxxx> wrote:

 Shure, I'll try to ...
 That would require the following things:
 1. A new table, say, PICDefaults, which would be locked on the
contents  of PortInterfaceCompat by means of a foreign key (with ON
DELETE CASCADE  option).

Would not

ALTER TABLE `PortInnerInterface` ADD `oif_id ` INT( 10 ) UNSIGNED NOT
NULL ;

Be the better place to put this ?

This would also work, but, strictly speaking, it wouldn't be better,
because this way the "default" value for an IIF wouldn't be locked to one
of the OIF options "enabled" for it. That said, I could live with that,
just name that coulmn "default_oif_id" to not break existing queries.

--
    Denis Ovsienko



Manon Goo
Dembach Goo Informatik GmbH & Co KG
Untersachsenhausen 33
D-50667 Köln
Tel: +49 221 801483 0
Mobil: +49 177 8091974
Fax: +49 221 801483 20
Email: manon@xxxxxxxx
Emergency: +49 180 555 4992

Amtsgericht Köln HRA 22794, UST ID: DE242 159 527
Geschäftsführer: Manon Goo, Andreas Dembach
Haftende Gesellschafterin: Dembach Goo Verwaltungs GmbH 

Other related posts: