PacketFence - BTS - PacketFence
View Issue Details
0001624PacketFenceupgradepublic2013-01-17 14:052013-01-21 14:56
ae3 
dwuelfrath 
normalminoralways
resolvedfixed 
3.6.1 
+03.6.1 
11acb8b4d1728b8e09546a01ac234ecff18e0c9c
0001624: db/upgrade-3.5.0-3.6.1.sql has primary key error
When I run the database schema update on ZEN 3.6.0 to upgrade to 3.6.1, MySQL terminates with error 1062 as shown under additional information below. I had previously added custom categories through the admin web GUI, and the first one was automatically assigned node_category 3. Hence, the primary key conflict for me, and anyone else who defined custom categories.

I do not know if there is a dependency on node_category=3 for gaming devices elsewhere in the code, but I created the entry via the admin web GUI and it assigned it 0000008. If there is no dependency on that entry being 0000003, you could just drop the "category_id" and "3" from the insert command since the table was created with category_id defined as auto_increment so it will always use the next number on insert.
[root@pf-zen-esx pf]# mysql -u pf -p pf -v < db/upgrade-3.5.0-3.6.1.sql
Enter password:
--------------
INSERT INTO `node_category` (category_id,name,notes) VALUES ("3","gaming","Gaming devices")
--------------

ERROR 1062 (23000) at line 5: Duplicate entry '3' for key 'PRIMARY'
[root@pf-zen-esx pf]#
No tags attached.
Issue History
2013-01-17 14:05ae3New Issue
2013-01-18 14:48dwuelfrathStatusnew => assigned
2013-01-18 14:48dwuelfrathAssigned To => dwuelfrath
2013-01-18 14:51dwuelfrathNote Added: 0003292
2013-01-18 14:51dwuelfrathBuild => stable
2013-01-18 14:51dwuelfrathTarget Version => +1
2013-01-21 14:23dwuelfrathfixed in git revision => 11acb8b4d1728b8e09546a01ac234ecff18e0c9c
2013-01-21 14:23dwuelfrathNote Added: 0003293
2013-01-21 14:23dwuelfrathStatusassigned => resolved
2013-01-21 14:23dwuelfrathResolutionopen => fixed
2013-01-21 14:23dwuelfrathFixed in Version => 3.6.1
2013-01-21 14:56dwuelfrathTarget Version+1 => +0

Notes
(0003292)
dwuelfrath   
2013-01-18 14:51   
Will commit fix
(0003293)
dwuelfrath   
2013-01-21 14:23   
Fixed in 3.6.1 stable branch as of 2012.01.21