Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix mysql and postgres migration script of 1.9.20 #272

Conversation

kenchan0130
Copy link
Contributor

@kenchan0130 kenchan0130 commented Jun 10, 2020

What happened

  • The result of migration sql is not equivalent to testlink_create_tables
  • Error occurs during migration when upgrading

Survey results

The mysql migration script from 1.9.19 to 1.9.20 expects

enable_on_design tinyint(1) unsigned NOT NULL default '0',
enable_on_execution tinyint(1) unsigned NOT NULL default '1',
.
However,platforms.enable_on_design and platforms.enable_on_execution are not migrating correctly.

Since
https://github.com/TestLinkOpenSourceTRMS/testlink-code/blob/testlink_1_9/install/sql/postgres/testlink_create_default_data.sql
or
https://github.com/TestLinkOpenSourceTRMS/testlink-code/blob/testlink_1_9/install/sql/mysql/testlink_create_default_data.sql
is executed by https://github.com/TestLinkOpenSourceTRMS/testlink-code/blob/testlink_1_9/install/installNewDB.php.
When executed in the migration script, it will be

Error executing 'postInstallation': MySQL command failed to run. Error:
  ERROR 1062 (23000) at line 11: Duplicate entry '55' for key 'PRIMARY'

Impacted area

This affects all users who are using 1.9.19 and below and upgrading to 1.9.20.
Users using from 1.9.20 are not affected.

What did I do

  • Change the settings for platforms.enable_on_design and platforms.enable_on_execution columns in db_schema_update.sql.
  • Remove inserting data into the rights table in db_schema_update.sql

Covered #251

@squash-labs
Copy link

squash-labs bot commented Jun 10, 2020

Manage this branch in Squash

Test this branch here: https://kenchan0130fix-mysql-migration-n5jn2.squash.io

@kenchan0130 kenchan0130 changed the title Fix mysql migration of 1.9.20 Fix mysql migration script of 1.9.20 Jun 10, 2020
@kenchan0130 kenchan0130 changed the title Fix mysql migration script of 1.9.20 Fix mysql and postgres migration script of 1.9.20 Jun 10, 2020
@kenchan0130
Copy link
Contributor Author

@fmancardi
Could you check this?
I am having trouble upgrading to a latest version.

@fmancardi
Copy link
Contributor

Dear user, I hope you can understand that expecting a response in some short period of time in Open Source project that has no company support is not a lot realistic.
Thanks for your findings.
I'm going to try to find time to apply the fixes

@kenchan0130
Copy link
Contributor Author

We understand that this is difficult to do with OSS and no support.
I reminded myself that the inability to upgrade is a problem for this project and many users.

I'm sorry to have rushed you.

@kenchan0130
Copy link
Contributor Author

I would like to know the current status.

@bohsen
Copy link

bohsen commented May 19, 2021

Friendly ping. This issue still persists. Hopefully this will get merged.

@fmancardi
Copy link
Contributor

fmancardi commented May 19, 2021

Hi
I've checked an

  1. the right branch to use for the latest fixed code is testlink_1_9_20_fixed

  2. I do not understand why you have issues with the new rights because (I'm going to double check) they are really part of 1.9.20 then I do not understand the conflict.

  3. please next time try to avoid the generation of lot of diff (at least on github diff feature) due to spaces, because makes the comparison difficult.

  4. would you mind to explain WHY the unsigned keyword is needed in the enable_on_design and enable_on_execution ?

@bohsen
Copy link

bohsen commented May 19, 2021

@fmancardi Thanks for your reply, but after I've investigated this issue all day today trying to revive an old TestLink database (that sadly wasn't backed up) I don't think this PR will fix the issue, as I don't believe TestLink causes it.

Our installation is using a slightly modified version of the Bitnami docker-compose Image for Testlink and I'm pretty sure the error can be traced back to a failed update applied through this docker-compose setup earlier.

When investigating the database using PhpMyAdmin I can see the changes from the sql update-script have been been applied and this upgrade is actually now blocking us from applying the update-script again, as the new columns in the tables are already present. This explains the error reported by @kenchan0130 that I'm also seeing.

Been trying to revert the schema manually and then starting the docker image again (this applies the upgrade), but as of yet without luck.
Sorry for the inconvenience and thank you for all your work on TestLink 👍

Sidenote: I'm actually not sure if the Bitnami-TestLink image is using the testlink_1_9_20_fixed branch. They push updates to the image, but I wonder if any of these are really related to TestLink. I saw version 1.9.20-6 in their repository. I wonder what this implies.

@fmancardi
Copy link
Contributor

Hi
I'm going to close this Pull Request.

Because code from testlink_1_9_20_fixed has not been released with a tag, Bitnami do not use it.
The changes you see in bitnami releases i.e. version 1.9.20-6 are related just to bitnami changes in their component.

best regards

@fmancardi fmancardi closed this May 20, 2021
@kenchan0130 kenchan0130 deleted the fix-mysql-migration-1.9.20 branch May 20, 2021 10:36
@kenchan0130
Copy link
Contributor Author

@fmancardi @bohsen

I have sent out another PR to address your requirements.

#309

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants