Skip to content

Commit

Permalink
minor: add migration for erroeneous javdatabase actor entries (xbapps…
Browse files Browse the repository at this point in the history
…#1391)

Co-authored-by: crwxaj <crwxaj>
  • Loading branch information
crwxaj authored Sep 4, 2023
1 parent 467ae6c commit 276c63b
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions pkg/migrations/migrations.go
Original file line number Diff line number Diff line change
Expand Up @@ -1729,6 +1729,23 @@ func Migrate() {
return tx.Exec(sql).Error
},
},
{
ID: "0069-fix-javdatabase-actors",
Migrate: func(tx *gorm.DB) error {
var actors []models.Actor
err := tx.Where("name like ?", "<img src%").Find(&actors).Error
if err != nil {
return err
}

for _, actor := range actors {
common.Log.Infof("Removing actor %s", actor.Name)
db.Model(&actor).Association("Scenes").Clear()
db.Delete(&actor)
}
return nil
},
},
})

if err := m.Migrate(); err != nil {
Expand Down

0 comments on commit 276c63b

Please sign in to comment.