Skip to content

Commit 00fbba4

Browse files
JaBistDuNarrischJaBistDuNarrisch
authored andcommitted
Added test for not yet fixed issue
1 parent 356a185 commit 00fbba4

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

src/Migrator.Tests/Providers/SQLServer/SQLServerTransformationProvider_ChangeColumnTests.cs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,22 @@ public void ChangeColumn_DateTimeToDateTime2_Success()
3535
Assert.That(columnBefore.Type == DbType.DateTime);
3636
Assert.That(columnAfter.Type == DbType.DateTime2);
3737
}
38+
39+
[Test, Ignore("This issue is not yet fixed. See https://github.com/dotnetprojects/Migrator.NET/issues/132")]
40+
public void ChangeColumn_WithUniqueThenReChangeToNonUnique_UniqueConstraintShouldBeRemoved()
41+
{
42+
// Arrange
43+
const string tableName = "TestTable";
44+
const string columnName = "TestColumn";
45+
46+
Provider.AddTable(tableName, new Column(columnName, DbType.Int32, ColumnProperty.NotNull));
47+
48+
// Act
49+
Provider.ChangeColumn(tableName, new Column(columnName, DbType.Int32, ColumnProperty.NotNull | ColumnProperty.Unique));
50+
Provider.ChangeColumn(tableName, new Column(columnName, DbType.Int32, ColumnProperty.NotNull));
51+
52+
// Assert
53+
var indexes = Provider.GetIndexes(tableName);
54+
Assert.That(indexes, Is.Empty);
55+
}
3856
}

0 commit comments

Comments
 (0)