Skip to content

Commit

Permalink
Remove duplicated func
Browse files Browse the repository at this point in the history
  • Loading branch information
amitaibu committed Sep 16, 2024
1 parent c957833 commit 2ce5f4f
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions ihp-ide/IHP/SchemaCompiler.hs
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ dataFields table@(CreateTable { name, columns }) = columnFields <> queryBuilderF
let fieldName = columnNameToFieldName column.name
in
( fieldName
, if isVariableAttribute table column
, if isRefCol table column
then fieldName
else haskellType table column
)
Expand Down Expand Up @@ -503,11 +503,7 @@ columnsReferencingTable theTableName =
_ -> Nothing

variableAttributes :: (?schema :: Schema) => CreateTable -> [Column]
variableAttributes table@(CreateTable { columns }) = filter (isVariableAttribute table) columns

isVariableAttribute :: (?schema :: Schema) => CreateTable -> Column -> Bool
isVariableAttribute = isRefCol

variableAttributes table@(CreateTable { columns }) = filter (isRefCol table) columns

-- | Returns @True@ when the column is referencing another column via foreign key constraint
isRefCol :: (?schema :: Schema) => CreateTable -> Column -> Bool
Expand Down

0 comments on commit 2ce5f4f

Please sign in to comment.