3
0

Make page layout handles unique per page not ns

This commit is contained in:
Tomaž Jerman
2023-03-28 16:47:27 +02:00
committed by Jože Fortun
parent 9d37d8c949
commit 4f77edce5e
3 changed files with 6 additions and 1 deletions

View File

@@ -523,6 +523,7 @@ func (e YamlEncoder) encodePage(ctx context.Context, p envoyx.EncodeParams, node
"description", res.Description,
"handle", res.Handle,
"id", res.ID,
"meta", res.Meta,
"moduleID", auxModuleID,
"namespaceID", auxNamespaceID,
"selfID", auxSelfID,

View File

@@ -945,6 +945,10 @@ var PageLayout = &dal.Model{
Modifiers: []dal.IndexFieldModifier{"LOWERCASE"},
},
{
AttributeIdent: "PageID",
},
{
AttributeIdent: "NamespaceID",
},

View File

@@ -76,7 +76,7 @@ pageLayout: {
"page_id": { attribute: "page_id" },
"parent_id": { attribute: "parent_id" },
"unique_handle": {
fields: [{ attribute: "handle", modifiers: ["LOWERCASE"] }, { attribute: "namespace_id" }]
fields: [{ attribute: "handle", modifiers: ["LOWERCASE"] }, { attribute: "page_id" }, { attribute: "namespace_id" }]
predicate: "handle != '' AND deleted_at IS NULL"
}
}