This commit is contained in:
parent
aa2b056f8b
commit
d32818af09
8 changed files with 51 additions and 8 deletions
|
@ -25,6 +25,8 @@ type User struct {
|
|||
// identifier for users and other servers, especially when changing the username
|
||||
// (username != display name) might be a future feature
|
||||
// Same also applies for other types that use a UUID as primary key
|
||||
// TODO: Change this to generate via cuid or uuid, depending on config
|
||||
// Or remove autogeneration alltogether
|
||||
ID string `gorm:"primarykey;default:gen_random_uuid()"`
|
||||
// Username of the user (eg "max" if the full username is @max@example.com)
|
||||
// Assume unchangable (once set by a user) to be kind to other implementations
|
||||
|
|
|
@ -5,7 +5,6 @@ import (
|
|||
"database/sql"
|
||||
|
||||
"git.mstar.dev/mstar/goutils/other"
|
||||
"github.com/google/uuid"
|
||||
"gorm.io/gorm"
|
||||
|
||||
"git.mstar.dev/mstar/linstrom/config"
|
||||
|
@ -57,7 +56,7 @@ func insertDefaultDuck() (*models.MediaMetadata, error) {
|
|||
return nil, err
|
||||
}
|
||||
duck := models.MediaMetadata{
|
||||
ID: uuid.NewString(),
|
||||
ID: shared.NewId(),
|
||||
// NOTE: Default duck technically belongs to the server
|
||||
// but to avoid cyclic dependency, declare it as unowned
|
||||
OwnedById: sql.NullString{Valid: false},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue