refactor(documents): rename document owner fields

This commit is contained in:
2026-07-24 12:29:16 +08:00
parent ab8ba3c03f
commit f2d1fef2d6
16 changed files with 68 additions and 21 deletions

View File

@@ -116,7 +116,7 @@ func createPostgresSearchDocument(
t.Helper()
document.ProjectID = project.ID
document.ProjectIdentity = project.Identity
document.CreatedBy = ownerID
document.OwnerID = ownerID
document.Kind = models.DocumentKindFile
document.Extension = ".md"
document.MimeType = "text/markdown; charset=utf-8"

View File

@@ -55,7 +55,7 @@ func TestSearchAppliesStableFairGlobalLimitAcrossResultTypes(t *testing.T) {
document := models.SaDocumentTree{
Identity: fmt.Sprintf("00000000-0000-7003-8000-%012d", index),
ProjectID: project.ID,
CreatedBy: 7,
OwnerID: 7,
Kind: models.DocumentKindFile,
Name: fmt.Sprintf("稳定排序文档 %02d.md", index),
NormalizedName: fmt.Sprintf("稳定排序文档 %02d.md", index),
@@ -139,7 +139,7 @@ func TestSearchOnlyReturnsNavigableProjectTaskAndDocumentResults(t *testing.T) {
func createSearchDocument(t *testing.T, database *gorm.DB, projectID, userID uint, name, markdown, identity string, updatedAt time.Time) models.SaDocumentTree {
t.Helper()
document := models.SaDocumentTree{
Identity: identity, ProjectID: projectID, CreatedBy: userID, Kind: models.DocumentKindFile,
Identity: identity, ProjectID: projectID, OwnerID: userID, Kind: models.DocumentKindFile,
Name: name, NormalizedName: strings.ToLower(name), Extension: ".md",
MimeType: "text/markdown", Size: int64(len([]byte(markdown))), Revision: 1,
UpdatedAt: updatedAt,