DBIx-Class-Migration icon indicating copy to clipboard operation
DBIx-Class-Migration copied to clipboard

Postgres IDENTITY not recognised

Open willsheppard opened this issue 4 years ago • 0 comments

Postgres 10 introduced the syntax: INT GENERATED ALWAYS AS IDENTITY as a replacement for SERIAL, but the new syntax is not recognised, and so auto_increment flag is missing from new identity columns.

This SQL:

CREATE TABLE client_order (
    id integer NOT NULL GENERATED ALWAYS AS IDENTITY
);

...gets converted to:

__PACKAGE__->add_columns(
    "id",
    { data_type => "integer", is_nullable => 0 },
);

...but I expected:

__PACKAGE__->add_columns(
    "id",
    { data_type => "integer", is_nullable => 0, auto_increment => 1 },
);

willsheppard avatar Oct 02 '20 09:10 willsheppard