-
Notifications
You must be signed in to change notification settings - Fork 297
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
persistent-mysql: treat tinyint as SqlOther "tinyint", not SqlBool #1526
Conversation
This looks reasonable to me. It relies on the exception documented in the MySQL 8.0.19 release notes concerning the deprecation of the width specification for integer data types - it does appear that there is an intention to retain There are a couple of things you could do to tidy up the code:
|
Thank you for a comment. Given that they intend to keep |
@parsonsmatt can you see any issues with this? Just to make sure we don't break anything! |
Code looks fine to me. I'm curious if you could write a test to demonstrate the behavior you're looking for? |
I added a unit test that tests this behaviour. Would that suffice? |
@@ -74,6 +74,7 @@ import qualified Data.Text.IO as T | |||
import GHC.Stack | |||
import System.Environment (getEnvironment) | |||
|
|||
import Database.Persist.MySQL.Internal |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this file wasn't checked in
I'd prefer to see that |
sometimes localhost doesn't work on Mac
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fantastic, thanks! I'll go ahead and release this.
I noticed that our application reports schema mismatch after upgrading to MySQL 8.0, even if I change the column type to
SqlOther "tinyint"
(removing the width). I realised that the recent versions of persistent-mysql parses tinyint as SqlBool, but it doesn't work in our usecase, where some tinyint columns represent non-Boolean values.After this change, I confirmed that our application works both on MySQL 5.7 and MySQL 8.0, but I'm not quite confident that this change is in the right direction. What are your thoughts?
Before submitting your PR, check that you've:
@since
declarations to the Haddockstylish-haskell
on any changed files..editorconfig
file for details)After submitting your PR:
(unreleased)
on the Changelog