Skip to content

DB migrations fail with postgres >=18 #1678

@owi92

Description

@owi92

Specifically: Migration 15-fix-event-constraints.sql cannot be applied, causing all subsequent migrations to be skipped.
So we cannot fix this with a new migration, but changing old migrations is also problematic because that would break existing deployments that are upgrading. A possible fix for those cases (if we were to fix it in migration 15) would be to run db unsafe-overwrite-migrations, but that is usually only for dev purposes and would complicate updates.
We should investigate other possibilites.

Some technical details:
PG 18 starts exposing NOT NULL constraints as proper pg_constraints that now show up in information_schema views, which we use in migration 15. That makes the constraint lookup return extra rows and fail. The info is a bit hidden in the release notes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions