webERP Forum

Full Version: Duplicate entry for key 'PRIMARY' webERP version 4.15.2
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I guess everything starts from table systypes, and if column typeno is not updated correctly it'll let to duplicate entry for whatever key. 

When I installed/upgraded to version 4.15.2 most accounts couldn't be update, 

I took a look to the systypes tables and I found out that all typeno where updated back to 0 and  under

line 19
PHP Code:
$SQL "UPDATE systypes SET typeno = typeno + 1 WHERE typeid = '" $TransType "'"

increments any primary ID of a give account ID (typename), however I don't get it why that when I ran the upgrade all my typeno was updated to back to 0, Hence facing Duplicate entry  for key 'PRIMARY' for almost everything
Unfortunately I don't have any tips, but I can say I upgraded a site to 4.15.2 without issue (the site was running pre-4.15.2 code that was pulled from git and not modified).