mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-12-05 00:18:07 -06:00
[chore] replace statuses.updated_at column with statuses.edited_at (#3636)
* update statuses table to replace updated_at column with edited_at * code comment * better code comments, fix setting of status + edit + mention + poll database times * fix log to logf call * fix status.EditIDs not being carried over in dereferencer.encrichStatus() * move status.EditID setting into handleStatusEdit()
This commit is contained in:
parent
e9bb7ddd3a
commit
c013892ca2
23 changed files with 417 additions and 118 deletions
|
|
@ -21,7 +21,6 @@ import (
|
|||
"context"
|
||||
"errors"
|
||||
"slices"
|
||||
"time"
|
||||
|
||||
"github.com/superseriousbusiness/gotosocial/internal/db"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/gtscontext"
|
||||
|
|
@ -158,17 +157,6 @@ func (p *pollDB) UpdatePoll(ctx context.Context, poll *gtsmodel.Poll, cols ...st
|
|||
|
||||
return p.state.Caches.DB.Poll.Store(poll, func() error {
|
||||
return p.db.RunInTx(ctx, nil, func(ctx context.Context, tx bun.Tx) error {
|
||||
// Update the status' "updated_at" field.
|
||||
if _, err := tx.NewUpdate().
|
||||
Table("statuses").
|
||||
Where("? = ?", bun.Ident("id"), poll.StatusID).
|
||||
SetColumn("updated_at", "?", time.Now()).
|
||||
Exec(ctx); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// Finally, update poll
|
||||
// columns in database.
|
||||
_, err := tx.NewUpdate().
|
||||
Model(poll).
|
||||
Column(cols...).
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue