1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2024-12-16 11:37:58 +02:00
Sonarr/NzbDrone.Services/NzbDrone.Services.Service/Migrations/Migration20120226.cs
2012-02-26 18:13:11 -08:00

35 lines
1.3 KiB
C#

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();
}
}
}