After 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.
After upgrading from
2.1.0to2.1.2migrations started failing when deployed to servers using 9.x.Looking at the logs of migrations I see
Looks like the code checking version considers
nullas a valid "at least" version always and if not set using the newSetPostgresVersionsetting it fails with 9.x.I was able to fix the issue but wanted to report the bug as it breaks existing code.