Indexes are created with the same uniqueness when copying a table

New: Non-English episode support
New: Renamed Quality Profiles to Profiles and made them more powerful
New: Configurable wait time before grabbing a release to wait for a better quality
This commit is contained in:
Mark McDowall
2014-06-08 01:22:55 -07:00
parent b72678a9ad
commit 74a38415cf
182 changed files with 2493 additions and 2433 deletions
@@ -6,6 +6,7 @@ using NzbDrone.Core.Datastore.Migration.Framework;
using NzbDrone.Core.Test.Framework;
using NzbDrone.Core.Tv;
using System.Linq;
using NzbDrone.Test.Common;
namespace NzbDrone.Core.Test.Datastore.SQLiteMigrationHelperTests
{
@@ -119,5 +120,23 @@ namespace NzbDrone.Core.Test.Datastore.SQLiteMigrationHelperTests
newColumns.Values.Should().HaveSameCount(columns.Values);
newIndexes.Should().Contain(i=>i.Column == "AirTime");
}
[Test]
public void should_create_indexes_with_the_same_uniqueness()
{
var columns = _subject.GetColumns("Series");
var indexes = _subject.GetIndexes("Series");
var tempIndexes = indexes.JsonClone();
tempIndexes[0].Unique = false;
tempIndexes[1].Unique = true;
_subject.CreateTable("Series_New", columns.Values, tempIndexes);
var newIndexes = _subject.GetIndexes("Series_New");
newIndexes.Should().HaveSameCount(tempIndexes);
newIndexes.ShouldAllBeEquivalentTo(tempIndexes, options => options.Excluding(o => o.IndexName).Excluding(o => o.Table));
}
}
}