[Files Refactor] Set primary flag when cleaning (#2880)

* Ensure single primary per object
* Set primary file during clean
* Only show migration notes for actual migrations
This commit is contained in:
WithoutPants
2022-09-05 11:46:18 +10:00
parent 7159ab69a3
commit 6b0bcdea88
12 changed files with 117 additions and 21 deletions

View File

@@ -193,6 +193,12 @@ func (qb *ImageStore) UpdatePartial(ctx context.Context, id int, partial models.
}
}
if partial.PrimaryFileID != nil {
if err := imagesFilesTableMgr.setPrimary(ctx, id, *partial.PrimaryFileID); err != nil {
return nil, err
}
}
return qb.find(ctx, id)
}