1
0
Fork 0
mirror of https://github.com/Radarr/Radarr synced 2024-12-27 02:09:59 +00:00
Radarr/NzbDrone.Services/NzbDrone.Services.Service/Migrations/Migration20120226.cs

35 lines
1.3 KiB
C#
Raw Normal View History

using System;
using System.Data;
using System.Linq;
using Migrator.Framework;
namespace NzbDrone.Services.Service.Migrations
{
[Migration(20120226)]
public class Migration20120226 : Migration
{
public override void Up()
{
Database.RenameTable("PendingSceneMappings", "OldPendingSceneMappings");
Database.AddTable("PendingSceneMappings", new[]
{
new Column("MappingId", DbType.Int32, ColumnProperty.PrimaryKeyWithIdentity),
new Column("CleanTitle", DbType.String, ColumnProperty.NotNull),
new Column("Id", DbType.Int32, ColumnProperty.NotNull),
new Column("Title", DbType.String, ColumnProperty.NotNull)
});
Database.ExecuteNonQuery(@"INSERT INTO PendingSceneMappings (CleanTitle, Id, Title)
SELECT CleanTitle, Id, Title
FROM OldPendingSceneMappings");
Database.RemoveTable("OldPendingSceneMappings");
}
public override void Down()
{
throw new NotImplementedException();
}
}
}