Skip to content

Commit

Permalink
Revert "Use PERFORM within PL/pgSQL block to discard result (#1092)"
Browse files Browse the repository at this point in the history
This reverts commit f9e62e5.

Fixes #1154
  • Loading branch information
roji committed Dec 9, 2019
1 parent a5687b0 commit 6786e9c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/EFCore.PG/Migrations/NpgsqlMigrationsSqlGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ protected override void Generate(AlterColumnOperation operation, IModel model, M
.AppendLine($"ALTER SEQUENCE {sequence} RENAME TO {oldSequenceWithoutSchema};")
.AppendLine($"ALTER TABLE {table} ALTER COLUMN {column} DROP DEFAULT;")
.AppendLine($"ALTER TABLE {table} ALTER COLUMN {column} ADD GENERATED {identityTypeClause} AS IDENTITY;")
.AppendLine($"PERFORM setval('{sequence}', nextval('{oldSequence}'), false);")
.AppendLine($"SELECT * FROM setval('{sequence}', nextval('{oldSequence}'), false);")
.AppendLine($"DROP SEQUENCE {oldSequence};");
break;
default:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -716,7 +716,7 @@ public void AlterColumnOperation_serial_to_identity()
ALTER SEQUENCE ""People_Id_seq"" RENAME TO ""People_Id_old_seq"";
ALTER TABLE ""People"" ALTER COLUMN ""Id"" DROP DEFAULT;
ALTER TABLE ""People"" ALTER COLUMN ""Id"" ADD GENERATED ALWAYS AS IDENTITY;
PERFORM setval('""People_Id_seq""', nextval('""People_Id_old_seq""'), false);
SELECT * FROM setval('""People_Id_seq""', nextval('""People_Id_old_seq""'), false);
DROP SEQUENCE ""People_Id_old_seq"";
");
}
Expand Down

0 comments on commit 6786e9c

Please sign in to comment.