Skip to content

Sequence migrations fails after updating from 2.1.0 to 2.1.2 #681

@eduardocampano

Description

@eduardocampano

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions