1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2024-12-16 11:37:58 +02:00
Sonarr/NzbDrone.Core/Datastore/Migrations/Migration20130203.cs

33 lines
939 B
C#
Raw Normal View History

2013-02-04 07:18:59 +03:00
using System.Collections.Generic;
using Migrator.Framework;
using NzbDrone.Core.Repository;
using NzbDrone.Core.RootFolders;
namespace NzbDrone.Core.Datastore.Migrations
{
[Migration(20130203)]
public class Migration20130203 : NzbDroneMigration
{
protected override void MainDbUpgrade()
{
var objectDb = GetObjectDb();
var rootFolderRepo = new RootFolderRepository(objectDb);
using (var dataReader = Database.ExecuteQuery("SELECT * from RootDirs"))
{
2013-02-05 07:07:07 +03:00
var dirs = new List<RootFolder>();
2013-02-04 07:18:59 +03:00
while (dataReader.Read())
{
2013-02-05 07:07:07 +03:00
var rootFolder = new RootFolder { Path = dataReader["Path"].ToString() };
2013-02-04 07:18:59 +03:00
dirs.Add(rootFolder);
}
objectDb.InsertMany(dirs);
}
//Database.RemoveTable("RootDirs");
}
}
}