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

veridicus’s picture

There'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.

nsk’s picture

I 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.

veridicus’s picture

I 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.

veridicus’s picture

The 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.

nsk’s picture

good work!

Anonymous’s picture