Skip to content

Commit

Permalink
Fix wrong comma when no parent table
Browse files Browse the repository at this point in the history
  • Loading branch information
amitaibu committed Aug 15, 2024
1 parent bebd467 commit 765a969
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions ihp-ide/IHP/SchemaCompiler.hs
Original file line number Diff line number Diff line change
Expand Up @@ -351,10 +351,11 @@ compileData table@(CreateTable { name, inherits }) =
typeArguments :: Text
typeArguments = dataTypeArguments table |> unwords

-- Include fields from parent tables
-- Include fields from parent table, if any.
parentFields = inherits
|> maybe "" (\parentTable -> compileParentFields parentTable)
|> (<> ", ")
-- Add comma, if there are fields from parent tables
|> (\parentFields -> if null parentFields then "" else parentFields <> ", ")

compileParentFields parentTable =
let parentTableDef = findTableByName parentTable
Expand Down

0 comments on commit 765a969

Please sign in to comment.