Skip to content

Commit

Permalink
XXX: Fix wrong postgres type for SqlInt64
Browse files Browse the repository at this point in the history
Solution taken from brandonchinn178#75
  • Loading branch information
kaldonir committed Jun 2, 2021
1 parent 6e34422 commit d3fb340
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/Database/Persist/Migration/Postgres.hs
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,10 @@ showColumn Column{..} = concatSql
(\sqls -> Text.unwords $ [quote colName, sqlType] ++ sqls)
$ map showColumnProp colProps
where
sqlType = if AutoIncrement `elem` colProps
then "SERIAL"
else showSqlType colType
sqlType = case (AutoIncrement `elem` colProps, colType) of
(True, SqlInt32) -> "SERIAL"
(True, SqlInt64) -> "BIGSERIAL"
_ -> showSqlType colType

-- | Show a 'SqlType'. See `showSqlType` from `Database.Persist.Postgresql`.
showSqlType :: SqlType -> Text
Expand Down

0 comments on commit d3fb340

Please sign in to comment.