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: refactor migrations; avoid mysql2 bugs by removing charset/collation directives #829

Merged
merged 2 commits into from
Nov 28, 2022

Conversation

csmig
Copy link
Member

@csmig csmig commented Nov 25, 2022

Refactor the initial six migrations:

  • wrap the migration code in try/catch blocks for reliability and to throw more specific error messages

Avoid invoking buggy behavior from the mysql2 library:

  • remove character set and collation directives from SQL scripts, which avoids mysql2 incorrectly over-writing its pool configuration options with the incorrect collation utf8mb4_general_ci.
  • explicitly set the collation of pool connections to utf8mb4_0900_ai_ci, in accodance with current MySQL 8.x defaults, to avoid mysql2 incorrectly defaulting to utf8mb4_unicode_ci.

Remove explicit charset/collation references from existing queries:

  • ReviewService.js
  • OperationService.js

@csmig csmig merged commit 3a233ad into NUWCDIVNPT:main Nov 28, 2022
@csmig csmig deleted the mysql2-import branch November 28, 2022 18:44
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.

1 participant