Remove unnecessary annotation table primary key

This commit is contained in:
Deluan
2024-06-29 11:45:41 -04:00
parent 81459cc421
commit 47378c6882
2 changed files with 66 additions and 3 deletions
-3
View File
@@ -6,7 +6,6 @@ import (
"time"
. "github.com/Masterminds/squirrel"
"github.com/google/uuid"
"github.com/navidrome/navidrome/conf"
"github.com/navidrome/navidrome/consts"
"github.com/navidrome/navidrome/log"
@@ -52,7 +51,6 @@ func (r sqlRepository) annUpsert(values map[string]interface{}, itemIDs ...strin
c, err := r.executeSQL(upd)
if c == 0 || errors.Is(err, sql.ErrNoRows) {
for _, itemID := range itemIDs {
values["ann_id"] = uuid.NewString()
values["user_id"] = userId(r.ctx)
values["item_type"] = r.tableName
values["item_id"] = itemID
@@ -83,7 +81,6 @@ func (r sqlRepository) IncPlayCount(itemID string, ts time.Time) error {
if c == 0 || errors.Is(err, sql.ErrNoRows) {
values := map[string]interface{}{}
values["ann_id"] = uuid.NewString()
values["user_id"] = userId(r.ctx)
values["item_type"] = r.tableName
values["item_id"] = itemID