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

[2.x] Update migration helper for translations table #2328

Merged
merged 1 commit into from
Nov 19, 2023
Merged

Conversation

sauron
Copy link
Contributor

@sauron sauron commented Aug 31, 2023

Description

I was bitten by a bug related to the lack of a default value for the active field in the translations table while adding a record in PostgreSQL.
The error was:

production.ERROR: SQLSTATE[23502]: Not null violation: 7 ERROR:  null value in column "active" of relation "metadata_translations" violates not-null constraint
DETAIL:  Failing row contains (3161, 49, null, 2023-08-30 12:31:23, 2023-08-30 12:31:23, de, null, xxxxxxxx, null, null, null, null). (SQL: insert into "metadata_translations" ("locale", "title", "metadata_id", "updated_at", "created_at") values (de, xxxxxxx, 49, 2023-08-30 12:31:23, 2023-08-30 12:31:23) returning "id")

The active field in PostgreSQL is not nullable and doesn't have a default value.
This issue doesn't happen while translating using Twill UI but by trying to do it programmatically.

This commit updates the migration helper for translations table to default active field to false to comply with some versions of PostgreSQL

Related Issues

Fixes #2326

…false to comply with some versions of PostgreSQL
@ifox ifox merged commit 945e97e into area17:2.x Nov 19, 2023
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants