summaryrefslogtreecommitdiff
path: root/internal/db/bundb/migrations/20220612091800_duplicated_media_cleanup.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/db/bundb/migrations/20220612091800_duplicated_media_cleanup.go')
-rw-r--r--internal/db/bundb/migrations/20220612091800_duplicated_media_cleanup.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/internal/db/bundb/migrations/20220612091800_duplicated_media_cleanup.go b/internal/db/bundb/migrations/20220612091800_duplicated_media_cleanup.go
index 4c4ada594..b0179ec4f 100644
--- a/internal/db/bundb/migrations/20220612091800_duplicated_media_cleanup.go
+++ b/internal/db/bundb/migrations/20220612091800_duplicated_media_cleanup.go
@@ -47,8 +47,8 @@ func init() {
}
if _, err := tx.NewDelete().
- Model(a).
- WherePK().
+ TableExpr("? AS ?", bun.Ident("media_attachments"), bun.Ident("media_attachment")).
+ Where("? = ?", bun.Ident("media_attachment.id"), a.ID).
Exec(ctx); err != nil {
l.Errorf("error deleting attachment with id %s: %s", a.ID, err)
} else {