Skip to content

Commit fe6adb7

Browse files
committed
Corrected breaking change in Npgsql 7.0
1 parent ff7643e commit fe6adb7

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

TestSupport/EfHelpers/Internal/NpgsqlDatabaseCleaner.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,13 +159,19 @@ NOT EXISTS (
159159

160160
private void DropCollations(NpgsqlConnection conn)
161161
{
162-
#if NET6_0_OR_GREATER
162+
#if NET6_0
163163
if (conn.Settings.ServerCompatibilityMode == ServerCompatibilityMode.Redshift)
164164
{
165165
return;
166166
}
167167
#endif
168168

169+
#if NET7_0_OR_GREATER
170+
var connectionStringBuilder = new NpgsqlConnectionStringBuilder(conn.ConnectionString);
171+
if (connectionStringBuilder.ServerCompatibilityMode == ServerCompatibilityMode.Redshift) return;
172+
#endif
173+
174+
169175
const string getUserCollations = @"SELECT nspname, collname
170176
FROM pg_collation coll
171177
JOIN pg_namespace ns ON ns.oid=coll.collnamespace

0 commit comments

Comments
 (0)