diff --git a/ihp-ide/IHP/IDE/SchemaDesigner/View/Layout.hs b/ihp-ide/IHP/IDE/SchemaDesigner/View/Layout.hs index 5f955a134..6e743ee65 100644 --- a/ihp-ide/IHP/IDE/SchemaDesigner/View/Layout.hs +++ b/ihp-ide/IHP/IDE/SchemaDesigner/View/Layout.hs @@ -223,9 +223,7 @@ renderColumnSelector tableName columns statements = [hsx| -
- Inherits: {inherits} -
+ {maybeInherits} {suggestedColumnsSection tableName columns} @@ -251,19 +249,23 @@ renderColumnSelector tableName columns statements = [hsx| {renderColumnIndexes tableName statements} |] - Nothing -> [hsx||] + Nothing -> "" auth :: Html auth = renderPolicies tableName statements - inherits = statements - |> find (\case - StatementCreateTable CreateTable { name } | name == tableName -> True - _ -> False) - -- Get the table that this table inherits from - |> \case - Just (StatementCreateTable CreateTable { inherits }) -> inherits - _ -> Nothing + maybeInherits = + statements + |> find \case + StatementCreateTable CreateTable { name } | name == tableName -> True + _ -> False + |> \case + Just (StatementCreateTable CreateTable { inherits = Just parentTableName }) -> + [hsx|
+ This table inherits from table {parentTableName} +
|] + _ -> "" + suggestedColumnsSection :: Text -> [(Int, Column)] -> Html