Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Column "id" is an identity column defined as GENERATED ALWAYS #199

Closed
ishanvyas22 opened this issue May 9, 2023 · 1 comment · Fixed by #200
Closed

Error: Column "id" is an identity column defined as GENERATED ALWAYS #199

ishanvyas22 opened this issue May 9, 2023 · 1 comment · Fixed by #200
Assignees
Labels
bug Something isn't working

Comments

@ishanvyas22
Copy link
Contributor

ishanvyas22 commented May 9, 2023

Currently postgres jobs are failing on PHP 8.0 & 8.2 with below error:

...

171) CakephpFixtureFactories\Test\TestCase\Scenario\FixtureScenarioTest::testLoadScenario with data set #2 ('TenAustralianAuthors', 10)
CakephpFixtureFactories\Error\FixtureScenarioException: Error in Factory CakephpFixtureFactories\Test\Factory\AuthorFactory.
 Message: SQLSTATE[428C9]: <<Unknown error>>: 7 ERROR:  cannot insert a non-DEFAULT value into column "id"
DETAIL:  Column "id" is an identity column defined as GENERATED ALWAYS.
HINT:  Use OVERRIDING SYSTEM VALUE to override. 

...

This is due to changes of phinx package in version 0.13.0 (PR: cakephp/phinx#2085).

@pabloelcolombiano pabloelcolombiano self-assigned this May 10, 2023
@pabloelcolombiano pabloelcolombiano added the bug Something isn't working label May 10, 2023
@pabloelcolombiano
Copy link
Collaborator

It is impossible with the actual phinx version to overwrite ID values.
See the issue here: cakephp/phinx#2193

A solution would be to add a ->disablePrimaryKeyOffset() to by-pass the random setting of the primary key and let the SQL engine manage the assignment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants