laminas/laminas-db

Unable to create Identity Column with Postgres

Fleuv opened this issue · 1 comments

Fleuv commented

Feature Request

Q A
New Feature yes
RFC no
BC Break no

Summary

There is no way to add an Identity Column using the classes offered to created DDL's.

This is the closest I've got to achieving this:

$column = new Integer('id');
$column->addConstraint(new PrimaryKey());

What generates the following SQL:

"id" INTEGER NOT NULL PRIMARY KEY

I expected to be able to use the $column->setOption($key, $value) method to be able to do something like:

...
$column->setOption('GENERATED ALWAYS AS IDENTITY', true);

And get the following SQL:

"id" INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY PRIMARY KEY

However it unfortunately had no affect.

This package is considered feature-complete, and is now in security-only maintenance mode, following a decision by the Technical Steering Committee.
If you have a security issue, please follow our security reporting guidelines.
If you wish to take on the role of maintainer, please nominate yourself

If you are looking for an actively maintained package alternative, we recommend: