@@ -169,7 +169,7 @@ protected override void Generate(
169169
170170 builder . Append ( "CREATE " ) ;
171171
172- if ( operation [ NpgsqlAnnotationNames . UnloggedTable ] is bool unlogged && unlogged )
172+ if ( operation [ NpgsqlAnnotationNames . UnloggedTable ] is true )
173173 {
174174 builder . Append ( "UNLOGGED " ) ;
175175 }
@@ -312,8 +312,8 @@ protected override void Generate(AlterTableOperation operation, IModel? model, M
312312 }
313313
314314 // Unlogged table (null is equivalent to false)
315- var oldUnlogged = operation . OldTable [ NpgsqlAnnotationNames . UnloggedTable ] is bool ou && ou ;
316- var newUnlogged = operation [ NpgsqlAnnotationNames . UnloggedTable ] is bool nu && nu ;
315+ var oldUnlogged = operation . OldTable [ NpgsqlAnnotationNames . UnloggedTable ] is true ;
316+ var newUnlogged = operation [ NpgsqlAnnotationNames . UnloggedTable ] is true ;
317317
318318 if ( oldUnlogged != newUnlogged )
319319 {
@@ -511,14 +511,14 @@ protected override void Generate(AlterColumnOperation operation, IModel? model,
511511 builder . AppendLine ( ";" ) ;
512512 }
513513
514- if ( operation . IsNullable && ! operation . OldColumn . IsNullable )
514+ if ( operation is { IsNullable : true , OldColumn . IsNullable : false } )
515515 {
516516 builder
517517 . Append ( alterBase )
518518 . Append ( "DROP NOT NULL" )
519519 . AppendLine ( ";" ) ;
520520 }
521- else if ( ! operation . IsNullable && operation . OldColumn . IsNullable )
521+ else if ( operation is { IsNullable : false , OldColumn . IsNullable : true } )
522522 {
523523 // The column is being made non-nullable. Generate an update statement before doing that, to convert any existing null values to
524524 // the default value (otherwise PostgreSQL fails).
@@ -2046,7 +2046,7 @@ private string IndexColumnList(IndexColumn[] columns, string? method)
20462046
20472047 // Of the built-in access methods, only btree (the default) supports
20482048 // sorting, thus we only want to emit sort options for btree indexes.
2049- if ( method is null || method == "btree" )
2049+ if ( method is null or "btree" )
20502050 {
20512051 if ( column . IsDescending )
20522052 {
0 commit comments