Mysql Upgradescript 1.5 to 1.6 produces error

Steps to reproduce

Steps to reproduce:
Do a upgrade from 1.5.0 to 1.6.0 with data in database

Actual Results:
Seemes to work but error occurs
ERROR 1050 (42S01): Table 'mh_job_mh_service_registration' already exists


Lars Kiesow
October 30, 2014, 3:27 PM

@Lukas, you wrote the update script. Can you have a look at this?

Lukas Rohner
November 3, 2014, 9:47 AM

I don't think there is a problem in the script. The table has already been existing as the ERROR describes.
This can be the case if you used auto ddl in earlier times.

Lars Kiesow
November 3, 2014, 10:00 AM

Or if you use the reqular ddl scripts which makes this a problem:

[lars@lkiesow]~/dev/opencast-matterhorn/docs/upgrade% grep -r mh_job_mh_service_registration *
1.3_to_1.4/mysql5.sql:CREATE TABLE mh_job_mh_service_registration (
1.3_to_1.4/mysql5.sql: CONSTRAINT `FK_mh_job_mh_service_registration_Job_id` FOREIGN KEY (`Job_id`) REFERENCES `mh_job` (`id`),
1.5_to_1.6/mysql5.sql:CREATE TABLE mh_job_mh_service_registration (
1.5_to_1.6/mysql5.sql: CONSTRAINT FK_mh_job_mh_service_registration_Job_id FOREIGN KEY (Job_id) REFERENCES mh_job (id) ON DELETE CASCADE,

Lukas Rohner
November 4, 2014, 4:33 PM

Hi Lars the table mh_job_mh_service_registration has been removed in version 1.5 and added back in version 1.6. Therefore the update script itself is right, but the update script from 1.4 to 1.5 doesn't remove it. So I will add a check if table is already existing and only add it if not.

Christian Greweling
November 6, 2014, 9:43 AM

@Lars: I think you are the one to review. It is working now without errors. Nice.


Lukas Rohner


Christian Greweling


Build Error

Tags (folksonomy)



Fix versions

Affects versions