View Issue Details

IDProjectCategoryView StatusLast Update
1835RackTablesdefaultpublic2018-07-20 09:40
Reporterigloo Assigned To 
PrioritynormalSeveritymajorReproducibilityalways
Status closedResolutionduplicate 
Product Version0.20.14 
Summary1835: Upgrade.php doesn't create FOREIGN KEY for CachedPNV
Descriptionupgrade.php doesnt create FOREIGN KEY for CachedPNV while upgrade from 0.19.11 to 0.20.14
Steps To ReproduceUpgrade from 0.19.11 to 0.20.14

MariaDB [racktables_db]> select * from information_schema.table_constraints where TABLE_SCHEMA='racktables_db' and TABLE_NAME='CachedPNV' \G;
*************************** 1. row ***************************
CONSTRAINT_CATALOG: def
 CONSTRAINT_SCHEMA: racktables_db
   CONSTRAINT_NAME: PRIMARY
      TABLE_SCHEMA: racktables_db
        TABLE_NAME: CachedPNV
   CONSTRAINT_TYPE: PRIMARY KEY
*************************** 2. row ***************************
CONSTRAINT_CATALOG: def
 CONSTRAINT_SCHEMA: racktables_db
   CONSTRAINT_NAME: port_id
      TABLE_SCHEMA: racktables_db
        TABLE_NAME: CachedPNV
   CONSTRAINT_TYPE: UNIQUE
2 rows in set (0.00 sec)



~/racktables/src/RackTables-0.20.14/wwwroot/inc]# grep CachedPNV upgrade.php
            $query[] = "ALTER TABLE `CachedPNV` CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci";
Additional Information0.20.0
~/racktables/src/racktables-RackTables-0.20.0/wwwroot/inc]# grep CachedPNV upgrade.php
CREATE TABLE `CachedPNV` (
  CONSTRAINT `CachedPNV-FK-compound` FOREIGN KEY (`object_id`, `port_name`, `vlan_id`) REFERENCES `CachedPAV` (`object_id`, `port_name`, `vlan_id`) ON DELETE CASCADE

Full query:
$query[] = "
CREATE TABLE `CachedPNV` (
  `object_id` int(10) unsigned NOT NULL,
  `port_name` char(255) NOT NULL,
  `vlan_id` int(10) unsigned NOT NULL default '0',
  PRIMARY KEY (`object_id`,`port_name`,`vlan_id`),
  UNIQUE KEY `port_id` (`object_id`,`port_name`),
  CONSTRAINT `CachedPNV-FK-compound` FOREIGN KEY (`object_id`, `port_name`, `vlan_id`) REFERENCES `CachedPAV` (`object_id`, `port_name`, `vlan_id`) ON
) ENGINE=InnoDB
";


0.20.14
~/racktables/src/RackTables-0.20.14/wwwroot/inc]# grep CachedPNV upgrade.php
            $query[] = "ALTER TABLE `CachedPNV` CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci";

0.21.1
~/racktables/src/RackTables-0.21.1/wwwroot/inc]# grep CachedPNV upgrade.php
            $query[] = "ALTER TABLE `CachedPNV` CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci"


TagsNo tags attached.

Relationships

duplicate of 1833 closed Upgrade.php doesn't create FOREIGN KEY for CachedPNV 

Activities

There are no notes attached to this issue.

Issue History

Date Modified Username Field Change
2018-07-20 09:13 igloo New Issue
2018-07-20 09:40 infrastation Relationship added duplicate of 1833
2018-07-20 09:40 infrastation Status new => closed
2018-07-20 09:40 infrastation Resolution open => duplicate