This commit is contained in:
Wieland, Marc
2026-06-26 15:22:17 +02:00
parent 782be5dd36
commit 56fa73656f
3 changed files with 912 additions and 4 deletions
-3
View File
@@ -912,8 +912,6 @@ static async Task EnsurePostgresIntegerPrimaryKeyDefaultAsync(System.Data.Common
using var cmd = conn.CreateCommand();
cmd.CommandText = $@"
DO $$
DECLARE
sequence_name text := '" + @"" + @"' || '{tableName}_Id_seq';
BEGIN
IF EXISTS (
SELECT 1
@@ -921,7 +919,6 @@ BEGIN
WHERE table_schema = 'public'
AND table_name = '{tableName}'
AND column_name = 'Id'
AND column_default IS NULL
) THEN
EXECUTE 'CREATE SEQUENCE IF NOT EXISTS public.""{tableName}_Id_seq""';
EXECUTE 'ALTER SEQUENCE public.""{tableName}_Id_seq"" OWNED BY public.""{tableName}"".""Id""';