Skip to content

Commit

Permalink
persistent-mysql: treat tinyint as SqlOther "tinyint", not SqlBool
Browse files Browse the repository at this point in the history
  • Loading branch information
fumieval committed Nov 28, 2023
1 parent 9f9019f commit 71efb6b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion persistent-mysql/Database/Persist/MySQL.hs
Original file line number Diff line number Diff line change
Expand Up @@ -834,7 +834,8 @@ parseColumnType :: Text -> ColumnInfo -> ExceptT String IO (SqlType, Maybe Integ
-- value explicitly set in `showSqlType` for SqlBool).
--
parseColumnType "tinyint" ci
| ciColumnType ci == "tinyint" || ciColumnType ci == "tinyint(1)" = return (SqlBool, Nothing)
| ciColumnType ci == "tinyint(1)" = return (SqlBool, Nothing)
| Just _ <- T.stripPrefix "tinyint" (ciColumnType ci) = return (SqlOther "tinyint", Nothing)
parseColumnType "int" ci
| ciColumnType ci == "int" || ciColumnType ci == "int(11)" = return (SqlInt32, Nothing)
parseColumnType "bigint" ci
Expand Down

0 comments on commit 71efb6b

Please sign in to comment.