diff --git a/internal/db/update.go b/internal/db/update.go index 9b78e4d..48e22dc 100644 --- a/internal/db/update.go +++ b/internal/db/update.go @@ -38,12 +38,14 @@ var dbVersions = map[string]dbVersion{ "0.0.2": { NextVersion: "0.0.3", Upgrade: func(db *gorm.DB) error { + // delete all vendors, because we are going to change the more vendor table, e.g. bilibili_vendors return db.Migrator().DropTable("streaming_vendor_infos") }, }, "0.0.3": { NextVersion: "", Upgrade: func(db *gorm.DB) error { + // alist and emby movies path are changed, so we need to delete them _ = db.Exec("DELETE FROM movies WHERE base_vendor_info_vendor IN ('alist', 'emby')").Error return db.Migrator().DropTable("alist_vendors", "emby_vendors") },