2
0

feat(repo): add owner display name field for repositories

Add OwnerDisplayName field to Repository model to allow custom display name for repository owner (e.g., "John Smith" instead of username). Used in license generation, social cards, and other public-facing contexts. Includes migration v368 to add column, UI in repository settings, and updates to license creation and social card rendering to use display name when available.
This commit is contained in:
2026-03-15 22:19:20 -04:00
parent 56fd71ad6b
commit 123eb78b54
12 changed files with 49 additions and 3 deletions

View File

@@ -442,6 +442,7 @@ func prepareMigrationTasks() []*migration {
newMigration(365, "Add public_app_integration to repository", v1_26.AddPublicAppIntegrationToRepository),
newMigration(366, "Add page experiment tables for A/B testing", v1_26.AddPageExperimentTables),
newMigration(367, "Add pages translation table for multi-language support", v1_26.AddPagesTranslationTable),
newMigration(368, "Add owner_display_name to repository", v1_26.AddOwnerDisplayNameToRepository),
}
return preparedMigrations
}

View File

@@ -0,0 +1,16 @@
// Copyright 2026 MarketAlly. All rights reserved.
// SPDX-License-Identifier: MIT
package v1_26
import (
"xorm.io/xorm"
)
func AddOwnerDisplayNameToRepository(x *xorm.Engine) error {
type Repository struct {
OwnerDisplayName string `xorm:"VARCHAR(255)"`
}
return x.Sync(new(Repository))
}

View File

@@ -161,6 +161,7 @@ type Repository struct {
Description string `xorm:"TEXT"`
DisplayTitle string `xorm:"VARCHAR(255)"`
GroupHeader string `xorm:"VARCHAR(255)"`
OwnerDisplayName string `xorm:"VARCHAR(255)"`
LicenseType string `xorm:"VARCHAR(50)"`
Website string `xorm:"VARCHAR(2048)"`
OriginalServiceType api.GitServiceType `xorm:"index"`