From 637f5e25c881e618cd603570f16e5cdebbd1ab90 Mon Sep 17 00:00:00 2001 From: SonicGD Date: Wed, 30 Oct 2024 16:04:34 +0500 Subject: [PATCH] fix: trim database name cause postgres doesn't like it too long --- src/Sitko.Core.Xunit/DbBaseTestScope.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Sitko.Core.Xunit/DbBaseTestScope.cs b/src/Sitko.Core.Xunit/DbBaseTestScope.cs index e45dcb22e..fa3027f8c 100644 --- a/src/Sitko.Core.Xunit/DbBaseTestScope.cs +++ b/src/Sitko.Core.Xunit/DbBaseTestScope.cs @@ -41,7 +41,8 @@ protected void AddDbContext(TApplication application, string name, A { if (GetConfig(applicationContext.Configuration).UsePostgres) { - moduleOptions.Database = $"{Id}_{dbName}"; + var fullDbName = $"{Id.ToString()[..8]}_{dbName}"; + moduleOptions.Database = fullDbName; moduleOptions.EnableSensitiveLogging = true; moduleOptions.IncludeErrorDetails = true; configurePostgres?.Invoke(applicationContext, moduleOptions, Id, dbName);