Sequence migrations fails after updating from 2.1.0 to 2.1.2
See original GitHub issueAfter upgrading from 2.1.0
to 2.1.2
migrations started failing when deployed to servers using 9.x.
Looking at the logs of migrations I see
CREATE SEQUENCE "AspNetUserClaims_Id_seq" AS integer START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE NO CYCLE;
Npgsql.PostgresException (0x80004005): 42601: syntax error at or near "AS"
Looks like the code checking version considers null
as a valid “at least” version always and if not set using the new SetPostgresVersion
setting it fails with 9.x.
bool VersionAtLeast(int major, int minor)
=> _postgresVersion is null || new Version(major, minor) <= _postgresVersion;
I was able to fix the issue but wanted to report the bug as it breaks existing code.
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Unable to create migrations after upgrading to ASP.NET ...
After upgrading to ASP.NET Core 2.0, I can't seem to create migrations anymore. I'm getting. "An error occurred while calling method ' ...
Read more >Migrate from ASP.NET Core 2.1 to 2.2
This article outlines the prerequisites and most common steps for migrating an ASP.NET Core 2.1 project to ASP.NET Core 2.2.
Read more >Upgrade, Migration, and Patching Issues for Oracle Identity ...
This chapter describes issues associated with the upgrade and migration process of Oracle Identity and Access Management 11g Release 2 (11.1.2.1.0).
Read more >How To Upgrade ASP.NET Core 2.1 To ASP.NET Core 3.1 ...
NET Core application and need to upgrade it, this write-up will help you. The very first step for migration is changing the target...
Read more >Upgrading Airflow™ to a newer version - Apache Airflow
Upgrade preparation - make a backup of DB This can for example be caused by a broken network connection between your CLI and...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
The design of the compatibility checks is intended to assume the most recent version of PostgreSQL unless otherwise specified, which is why
null
always passes.It looks like the docs have a note about supporting the new
IDENTITY
columns, but not warning about needing to specify an explicit version to opt out of those changes.I can update the docs to include a breaking change warning for 2.1 and 2.2.
Related
#607 #611 #612 #639
Hi guys I’ve upgraded and this stills doesn’t work fully as expected, I’m using different contexts with different schemas, só as I’ve noted when generating on a different schema it doesn’t put the schema on the OWNED BY part of the SQL giving the follow error when trying to update: