You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
807 B
23 lines
807 B
7 years ago
|
using FluentMigrator;
|
||
|
using NzbDrone.Core.Datastore.Migration.Framework;
|
||
|
|
||
|
namespace NzbDrone.Core.Datastore.Migration
|
||
|
{
|
||
|
[Migration(3)]
|
||
|
public class add_medium_support : NzbDroneMigrationBase
|
||
|
{
|
||
|
protected override void MainDbUpgrade()
|
||
|
{
|
||
|
Alter.Table("Albums").AddColumn("Media").AsString().WithDefaultValue("");
|
||
|
Alter.Table("Tracks").AddColumn("MediumNumber").AsInt32().WithDefaultValue(0);
|
||
|
Alter.Table("Tracks").AddColumn("AbsoluteTrackNumber").AsInt32().WithDefaultValue(0);
|
||
|
|
||
|
Execute.Sql("UPDATE Tracks SET AbsoluteTrackNumber = TrackNumber");
|
||
|
|
||
|
Delete.Column("TrackNumber").FromTable("Tracks");
|
||
|
Alter.Table("Tracks").AddColumn("TrackNumber").AsString().Nullable();
|
||
|
|
||
|
}
|
||
|
}
|
||
|
}
|