Skip to content

Conversation

@michalsn
Copy link
Member

Description
This PR fixes tests migrations by ensuring the migrations_lock table is always removed.

No changelog entry, as this change is relevant only for tests.

Fixes #9832

Checklist:

  • Securely signed commits
  • Component(s) with PHPDoc blocks, only if necessary or adds value (without duplication)
  • Unit testing, with >80% coverage
  • User guide updated
  • Conforms to style guide

@michalsn michalsn added testing Pull requests that changes tests only 4.7 labels Dec 11, 2025
Copy link
Contributor

@neznaika0 neznaika0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this mean that *_lock is not needed all the time? After each lock, the table must be deleted.

@michalsn
Copy link
Member Author

@neznaika0 If we use migrations_lock, then the table should exist at all times. Deleting it defeats the purpose of having the locking mechanism in the first place. There is also no safe moment to remove it automatically - once one process finishes running migrations, another process may already be in progress and still need to check the lock status.

In tests, however, we drop this table, as it is only needed for a few specific test cases.

@michalsn michalsn merged commit 04a34ed into codeigniter4:4.7 Dec 12, 2025
47 checks passed
@michalsn
Copy link
Member Author

Thank you for the reviews!

@michalsn michalsn deleted the fix/tests-migration-lock branch December 12, 2025 07:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

4.7 testing Pull requests that changes tests only

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants