From ccbbd017ba4c70488b967611f7b8b4f6d9f017b7 Mon Sep 17 00:00:00 2001 From: Varun Rajput Date: Sun, 8 Dec 2024 17:42:24 +0530 Subject: [PATCH] Show On Delete constraint in Schema Designer --- ihp-ide/IHP/IDE/SchemaDesigner/View/Layout.hs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ihp-ide/IHP/IDE/SchemaDesigner/View/Layout.hs b/ihp-ide/IHP/IDE/SchemaDesigner/View/Layout.hs index 2105f17cc..b33fb84f3 100644 --- a/ihp-ide/IHP/IDE/SchemaDesigner/View/Layout.hs +++ b/ihp-ide/IHP/IDE/SchemaDesigner/View/Layout.hs @@ -404,7 +404,9 @@ renderColumn Column { name, columnType, defaultValue, notNull, isUnique } id tab Just value -> [hsx|default: {compileExpression value} |] Nothing -> mempty renderForeignKey = case findForeignKey statements tableName name of - Just addConstraint@AddConstraint { constraint = ForeignKeyConstraint { name = Just constraintName, referenceTable } } -> [hsx|FOREIGN KEY: {referenceTable}|] + Just addConstraint@AddConstraint { constraint = ForeignKeyConstraint { name = Just constraintName, referenceTable, onDelete = onDeleteConstraint } } -> [hsx|FOREIGN KEY: {referenceTable} (On Delete: {onDeleteText})|] + where + onDeleteText = tshow onDeleteConstraint _ -> mempty foreignKeyOption = case findForeignKey statements tableName name of Just addConstraint@AddConstraint { constraint = ForeignKeyConstraint { name = Just constraintName, referenceTable } } ->