fix detection label

fix schema migrator for enums
This commit is contained in:
Oleksandr Bezdieniezhnykh
2025-08-13 10:12:25 +03:00
parent 16e5853d67
commit 4780e8c61c
7 changed files with 45 additions and 14 deletions
+3
View File
@@ -85,6 +85,9 @@ public static class SchemaMigrator
if (underlyingType == typeof(bool))
return $"NOT NULL DEFAULT {(Convert.ToBoolean(defaultValue) ? 1 : 0)}";
if (underlyingType.IsEnum)
return $"NOT NULL DEFAULT {(int)defaultValue}";
if (underlyingType.IsValueType && defaultValue is IFormattable f)
return $"NOT NULL DEFAULT {f.ToString(null, System.Globalization.CultureInfo.InvariantCulture)}";