jjn1056 / DBIx-Class-Migration

Use DBIC::DeploymentHandler and DBIC::Fixtures together for a sane database versioning workflow

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Postgres IDENTITY not recognised

willsheppard opened this issue · 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 },
);