File tree Expand file tree Collapse file tree 1 file changed +42
-0
lines changed
test/EFCore.SqlServer.FunctionalTests/Scaffolding Expand file tree Collapse file tree 1 file changed +42
-0
lines changed Original file line number Diff line number Diff line change @@ -852,6 +852,48 @@ CREATE TABLE IndexTable (
852852 "DROP TABLE IndexTable;" ) ;
853853 }
854854
855+ [ ConditionalFact ]
856+ public void Create_multiple_indexes_on_same_column ( )
857+ {
858+ Test (
859+ @"
860+ CREATE TABLE IndexTable (
861+ Id int,
862+ IndexProperty int
863+ );
864+
865+ CREATE INDEX IX_One on IndexTable ( IndexProperty ) WITH (FILLFACTOR = 100);
866+ CREATE INDEX IX_Two on IndexTable ( IndexProperty ) WITH (FILLFACTOR = 50);" ,
867+ Enumerable . Empty < string > ( ) ,
868+ Enumerable . Empty < string > ( ) ,
869+ dbModel =>
870+ {
871+ var table = dbModel . Tables . Single ( ) ;
872+
873+ Assert . Equal ( 2 , table . Indexes . Count ) ;
874+ Assert . All (
875+ table . Indexes , c =>
876+ {
877+ Assert . Equal ( "dbo" , c . Table . Schema ) ;
878+ Assert . Equal ( "IndexTable" , c . Table . Name ) ;
879+ } ) ;
880+
881+ Assert . Collection (
882+ table . Indexes . OrderBy ( i => i . Name ) ,
883+ index =>
884+ {
885+ Assert . Equal ( "IX_One" , index . Name ) ;
886+ Assert . Equal ( 100 , index [ SqlServerAnnotationNames . FillFactor ] ) ;
887+ } ,
888+ index =>
889+ {
890+ Assert . Equal ( "IX_Two" , index . Name ) ;
891+ Assert . Equal ( 50 , index [ SqlServerAnnotationNames . FillFactor ] ) ;
892+ } ) ;
893+ } ,
894+ "DROP TABLE IndexTable;" ) ;
895+ }
896+
855897 [ ConditionalFact ]
856898 public void Create_foreign_keys ( )
857899 {
You can’t perform that action at this time.
0 commit comments