Ignore primary touched if isMany

This commit is contained in:
Mel O'Hagan 2023-01-19 14:29:47 +00:00
parent b4dcdfa84f
commit 50e571c1de
1 changed files with 3 additions and 1 deletions

View File

@ -95,7 +95,7 @@
if ($touched.toCol && !fromRelate.name) {
errObj.toCol = colNotSet
}
if ($touched.primary && !fromPrimary) {
if ($touched.primary && !isMany && !fromPrimary) {
errObj.primary = "Please pick the primary key"
}
// currently don't support relationships back onto the table itself, needs to relate out
@ -152,6 +152,8 @@
Object.keys($touched).length !== 0 &&
fromTable &&
toTable
$: console.log("Errors ", errors)
$: linkTable = through || toTable
$: relationshipTypes = [
{