Drop qt_users dependency for configs and track app version
This commit is contained in:
@@ -7,6 +7,7 @@ import (
|
||||
"log/slog"
|
||||
"time"
|
||||
|
||||
"git.mchus.pro/mchus/quoteforge/internal/appmeta"
|
||||
"git.mchus.pro/mchus/quoteforge/internal/db"
|
||||
"git.mchus.pro/mchus/quoteforge/internal/localdb"
|
||||
"git.mchus.pro/mchus/quoteforge/internal/models"
|
||||
@@ -605,15 +606,10 @@ func (s *Service) ensureConfigurationOwner(mariaDB *gorm.DB, cfg *models.Configu
|
||||
return fmt.Errorf("owner username is empty")
|
||||
}
|
||||
|
||||
userID, err := models.EnsureDBUser(mariaDB, ownerUsername)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if userID == 0 {
|
||||
return fmt.Errorf("resolved user ID is 0 for owner %q", ownerUsername)
|
||||
}
|
||||
|
||||
cfg.UserID = userID
|
||||
// user_id is legacy and no longer used for ownership in local-first mode.
|
||||
// Keep it NULL on writes; ownership is represented by owner_username.
|
||||
cfg.UserID = nil
|
||||
cfg.AppVersion = appmeta.Version()
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user