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 migration on added duplicated container settings #6997

Merged
merged 1 commit into from
May 10, 2024

Conversation

yurabakhtin
Copy link
Contributor

What kind of change does this PR introduce? (check at least one)

  • Bugfix

The PR fulfills these requirements:

  • It's submitted to the develop branch, not the master branch if no hotfix
  • All tests are passing
  • Changelog was modified

Other information:
https://github.com/humhub/humhub-internal/issues/246

@yurabakhtin yurabakhtin requested a review from luke- May 10, 2024 12:24
@luke-
Copy link
Contributor

luke- commented May 10, 2024

@marc-farre FYI

@luke- luke- enabled auto-merge May 10, 2024 14:11
@luke- luke- added this pull request to the merge queue May 10, 2024
Merged via the queue into develop with commit 3e1245e May 10, 2024
6 checks passed
@marc-farre
Copy link
Collaborator

Interesting, I wouldn't have thought about this eventuality, thanks for mentioning me.

@yurabakhtin Thanks for the fix!
Does it mean we should always check if the database is not already updated before applying a migration? E.g., if we add a column, we should check if it doesn't already exist?

@yurabakhtin
Copy link
Contributor Author

@yurabakhtin Thanks for the fix!
Does it mean we should always check if the database is not already updated before applying a migration? E.g., if we add a column, we should check if it doesn't already exist?

@marc-farre Your change is not related to a creating of new column, there was an issue related to duplicated records with unique index, really it shouldn't have happened for a normal migration call, it seems it happened because 2 migration processes were called twice ata the same time, that should be fixed from core side, I will review the code soon.

However for adding new column we should use humhub\components\Migration and methods like safeAddColumn(), safeCreateTable() and etc. which already check it for existing before a creating, instead of yii\db\Migration and addColumn().

@marc-farre
Copy link
Collaborator

@yurabakhtin Thanks.

@luke- I've added @yurabakhtin recommendations in the doc via the PR humhub/documentation#122

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.

None yet

3 participants