@@ -1815,7 +1815,10 @@ mod tests {
18151815 } if table == "users" && columns == & vec![ "id" . to_string( ) , "tenant_id" . to_string( ) ]
18161816 )
18171817 } ) ;
1818- assert ! ( has_remove, "Should have RemoveConstraint for old composite PK" ) ;
1818+ assert ! (
1819+ has_remove,
1820+ "Should have RemoveConstraint for old composite PK"
1821+ ) ;
18191822
18201823 let has_add = plan. actions . iter ( ) . any ( |a| {
18211824 matches ! (
@@ -1826,7 +1829,10 @@ mod tests {
18261829 } if table == "users" && columns == & vec![ "id" . to_string( ) ]
18271830 )
18281831 } ) ;
1829- assert ! ( has_add, "Should have AddConstraint for new single-column PK" ) ;
1832+ assert ! (
1833+ has_add,
1834+ "Should have AddConstraint for new single-column PK"
1835+ ) ;
18301836 }
18311837
18321838 #[ test]
@@ -1913,7 +1919,10 @@ mod tests {
19131919 } if table == "users" && columns == & vec![ "id" . to_string( ) ]
19141920 )
19151921 } ) ;
1916- assert ! ( has_remove, "Should have RemoveConstraint for old single-column PK" ) ;
1922+ assert ! (
1923+ has_remove,
1924+ "Should have RemoveConstraint for old single-column PK"
1925+ ) ;
19171926
19181927 let has_add = plan. actions . iter ( ) . any ( |a| {
19191928 matches ! (
@@ -1928,7 +1937,10 @@ mod tests {
19281937 ]
19291938 )
19301939 } ) ;
1931- assert ! ( has_add, "Should have AddConstraint for new 3-column composite PK" ) ;
1940+ assert ! (
1941+ has_add,
1942+ "Should have AddConstraint for new 3-column composite PK"
1943+ ) ;
19321944 }
19331945
19341946 #[ test]
@@ -1971,7 +1983,10 @@ mod tests {
19711983 ]
19721984 )
19731985 } ) ;
1974- assert ! ( has_remove, "Should have RemoveConstraint for old 3-column composite PK" ) ;
1986+ assert ! (
1987+ has_remove,
1988+ "Should have RemoveConstraint for old 3-column composite PK"
1989+ ) ;
19751990
19761991 let has_add = plan. actions . iter ( ) . any ( |a| {
19771992 matches ! (
@@ -1982,7 +1997,10 @@ mod tests {
19821997 } if table == "users" && columns == & vec![ "id" . to_string( ) ]
19831998 )
19841999 } ) ;
1985- assert ! ( has_add, "Should have AddConstraint for new single-column PK" ) ;
2000+ assert ! (
2001+ has_add,
2002+ "Should have AddConstraint for new single-column PK"
2003+ ) ;
19862004 }
19872005
19882006 #[ test]
@@ -2022,7 +2040,10 @@ mod tests {
20222040 } if table == "users" && columns == & vec![ "id" . to_string( ) , "tenant_id" . to_string( ) ]
20232041 )
20242042 } ) ;
2025- assert ! ( has_remove, "Should have RemoveConstraint for old PK with tenant_id" ) ;
2043+ assert ! (
2044+ has_remove,
2045+ "Should have RemoveConstraint for old PK with tenant_id"
2046+ ) ;
20262047
20272048 let has_add = plan. actions . iter ( ) . any ( |a| {
20282049 matches ! (
@@ -2033,7 +2054,10 @@ mod tests {
20332054 } if table == "users" && columns == & vec![ "id" . to_string( ) , "region_id" . to_string( ) ]
20342055 )
20352056 } ) ;
2036- assert ! ( has_add, "Should have AddConstraint for new PK with region_id" ) ;
2057+ assert ! (
2058+ has_add,
2059+ "Should have AddConstraint for new PK with region_id"
2060+ ) ;
20372061 }
20382062 }
20392063
@@ -2577,32 +2601,26 @@ mod tests {
25772601 // Column changing both nullable and comment
25782602 let from = vec ! [ table(
25792603 "users" ,
2580- vec![
2581- col( "id" , ColumnType :: Simple ( SimpleColumnType :: Integer ) ) ,
2582- {
2583- let mut c =
2584- col_with_comment( "email" , ColumnType :: Simple ( SimpleColumnType :: Text ) , None ) ;
2585- c. nullable = true ;
2586- c
2587- } ,
2588- ] ,
2604+ vec![ col( "id" , ColumnType :: Simple ( SimpleColumnType :: Integer ) ) , {
2605+ let mut c =
2606+ col_with_comment( "email" , ColumnType :: Simple ( SimpleColumnType :: Text ) , None ) ;
2607+ c. nullable = true ;
2608+ c
2609+ } ] ,
25892610 vec![ ] ,
25902611 ) ] ;
25912612
25922613 let to = vec ! [ table(
25932614 "users" ,
2594- vec![
2595- col( "id" , ColumnType :: Simple ( SimpleColumnType :: Integer ) ) ,
2596- {
2597- let mut c = col_with_comment(
2598- "email" ,
2599- ColumnType :: Simple ( SimpleColumnType :: Text ) ,
2600- Some ( "Required email" ) ,
2601- ) ;
2602- c. nullable = false ;
2603- c
2604- } ,
2605- ] ,
2615+ vec![ col( "id" , ColumnType :: Simple ( SimpleColumnType :: Integer ) ) , {
2616+ let mut c = col_with_comment(
2617+ "email" ,
2618+ ColumnType :: Simple ( SimpleColumnType :: Text ) ,
2619+ Some ( "Required email" ) ,
2620+ ) ;
2621+ c. nullable = false ;
2622+ c
2623+ } ] ,
26062624 vec![ ] ,
26072625 ) ] ;
26082626
@@ -2744,8 +2762,8 @@ mod tests {
27442762 vec![
27452763 col( "id" , ColumnType :: Simple ( SimpleColumnType :: Integer ) ) ,
27462764 col_nullable( "email" , ColumnType :: Simple ( SimpleColumnType :: Text ) , false ) , // nullable -> non-nullable
2747- col_nullable( "name" , ColumnType :: Simple ( SimpleColumnType :: Text ) , true ) , // non-nullable -> nullable
2748- col_nullable( "phone" , ColumnType :: Simple ( SimpleColumnType :: Text ) , true ) , // no change
2765+ col_nullable( "name" , ColumnType :: Simple ( SimpleColumnType :: Text ) , true ) , // non-nullable -> nullable
2766+ col_nullable( "phone" , ColumnType :: Simple ( SimpleColumnType :: Text ) , true ) , // no change
27492767 ] ,
27502768 vec![ ] ,
27512769 ) ] ;
@@ -2765,7 +2783,10 @@ mod tests {
27652783 } if table == "users" && column == "email"
27662784 )
27672785 } ) ;
2768- assert ! ( has_email_change, "Should detect email nullable -> non-nullable" ) ;
2786+ assert ! (
2787+ has_email_change,
2788+ "Should detect email nullable -> non-nullable"
2789+ ) ;
27692790
27702791 let has_name_change = plan. actions . iter ( ) . any ( |a| {
27712792 matches ! (
@@ -2778,7 +2799,10 @@ mod tests {
27782799 } if table == "users" && column == "name"
27792800 )
27802801 } ) ;
2781- assert ! ( has_name_change, "Should detect name non-nullable -> nullable" ) ;
2802+ assert ! (
2803+ has_name_change,
2804+ "Should detect name non-nullable -> nullable"
2805+ ) ;
27822806 }
27832807
27842808 #[ test]
0 commit comments