Skip to content

Conversation

@tomchkk
Copy link
Contributor

@tomchkk tomchkk commented Mar 10, 2023

Overview

  • I have performed a self review of my code
  • I have made corresponding changes to the documentation
  • I have commented my code, particularly in hard-to-understand areas
  • I have added sufficient logging
  • New and existing tests pass locally with my changes
  • The code modified as part of this PR has been covered with tests
  • The API spec has been modified inline with the changes in this PR

Problem statement

Running a mutex migration using the default database store requires the existence of a table to store cache locks. This present a chicken and egg problem if attempting to use the --mutex option.

Solution

This PR wraps the main call to run the MutexMigrationCommand class in a try/catch block, handling the existing DatabaseCacheTableNotFoundException to allow a standard migration to be run in the event that the exception is thrown.

Dependencies

n/a

Test procedures

n/a

Links

Deployment

Migrations

No

Environment variables

n/a

Deployment notes

n/a

@tomchkk
Copy link
Contributor Author

tomchkk commented Mar 10, 2023

@kubatek94 - looking at this initially I felt that it wasn't worth adding any additional command options but just to allow the --mutex option to always work. I'm open to differences of opinion though, of course 😊

@tomchkk tomchkk requested a review from kubatek94 March 10, 2023 16:25
Copy link

@kubatek94 kubatek94 left a comment

Choose a reason for hiding this comment

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

Happy days @tomchkk! I was more in favour of such solution as well, but thought you would prefer an extra option instead so didn't suggest that haha :D Nice change!

@tomchkk
Copy link
Contributor Author

tomchkk commented Mar 10, 2023

Happy days @tomchkk! I was more in favour of such solution as well, but thought you would prefer an extra option instead so didn't suggest that haha :D Nice change!

Should have just done it this way in the first place 😂

@tomchkk tomchkk merged commit 9189f41 into main Mar 10, 2023
@tomchkk tomchkk deleted the feature/handle-initial-migration branch March 10, 2023 16:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants