When I upgrade the database I get this error:
ERROR 1062 at line 88: Duplicate entry 'copyrights_cpyid' for key 1
I tried to install Copyright 4.5.0 on Drupal 4.5.2
When I upgrade the database I get this error:
ERROR 1062 at line 88: Duplicate entry 'copyrights_cpyid' for key 1
I tried to install Copyright 4.5.0 on Drupal 4.5.2
Comments
Comment #1
veridicus commentedThere's only been one release of the mysql file, so no upgrade is necessary. I'm assuming, though, that you dropped the copyright tables and re-ran the script. Unfortunately there's no IF statement possible in mysql scripts, so I have to perform an insert without checking if the key already exists. So you have 2 choices: comment out the line that starts with "INSERT INTO seqences" or delete that record from sequences before running the script.
I wish mysql scripts could have some batch processing logic so we could check things before creating/inserting, but we can't.
Comment #2
nsk commentedI think there is an SQL construct "IF NOT EXISTS".
Yes it is true that I ran the script after I removed the cvs version. However, IIRC I dropped the copyright table.
Comment #3
veridicus commentedI changed the mysql script so it'll work for installs as well as upgrades. I'll check it into CVS after some testing, hopefully tonight.
Comment #4
veridicus commentedThe mysql file has been updated in CVS. You can now run the mysql file as many times as you like (i.e. for first-time installs as well as upgrades). Run it with -f (--force) and it will always work, adding new columns as needed.
Comment #5
nsk commentedgood work!
Comment #6
(not verified) commented