Fix unique constraint on compose charts table

This commit is contained in:
Denis Arh
2022-09-14 12:18:43 +02:00
parent eebf971fd2
commit 198830e9de
2 changed files with 5 additions and 1 deletions
+1 -1
View File
@@ -37,7 +37,7 @@ chart: {
"primary": { attribute: "id" }
"namespace": { attribute: "namespace_id" },
"unique_handle": {
fields: [{ attribute: "handle", modifiers: ["LOWERCASE"] }]
fields: [{ attribute: "handle", modifiers: ["LOWERCASE"] }, { attribute: "namespace_id" }]
predicate: "handle != '' AND deleted_at IS NULL"
}
}
+4
View File
@@ -216,6 +216,10 @@ var Chart = &dal.Model{
AttributeIdent: "Handle",
Modifiers: []dal.IndexFieldModifier{"LOWERCASE"},
},
{
AttributeIdent: "NamespaceID",
},
},
},
},