2021-12-21 03:25:07 +00:00
|
|
|
using FluentMigrator;
|
|
|
|
using NzbDrone.Core.Datastore.Migration.Framework;
|
|
|
|
|
|
|
|
namespace NzbDrone.Core.Datastore.Migration
|
|
|
|
{
|
|
|
|
[Migration(202)]
|
|
|
|
public class remove_predb : NzbDroneMigrationBase
|
|
|
|
{
|
|
|
|
protected override void MainDbUpgrade()
|
|
|
|
{
|
2022-11-20 18:27:45 +00:00
|
|
|
// Set PreDb entries to Released
|
2021-12-21 03:25:07 +00:00
|
|
|
Update.Table("Movies").Set(new { MinimumAvailability = 3 }).Where(new { MinimumAvailability = 4 });
|
|
|
|
Update.Table("ImportLists").Set(new { MinimumAvailability = 3 }).Where(new { MinimumAvailability = 4 });
|
|
|
|
|
2022-11-20 18:27:45 +00:00
|
|
|
// Should never be set, but just in case
|
2021-12-21 03:25:07 +00:00
|
|
|
Update.Table("Movies").Set(new { Status = 3 }).Where(new { Status = 4 });
|
|
|
|
Update.Table("ImportListMovies").Set(new { Status = 3 }).Where(new { Status = 4 });
|
|
|
|
|
2022-11-20 18:27:45 +00:00
|
|
|
// Remove unused column
|
2021-12-21 03:25:07 +00:00
|
|
|
Delete.Column("HasPreDBEntry").FromTable("Movies");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|