Skip to content

We want PR merge conflicts instead of failed migrations in production deployment #1498

@jameshfisher

Description

@jameshfisher

Description

Often, devs merge to main, then migrations fail because the migration has an older timestamp than what has already run on main. The problem is that the dev should have got a merge conflict on their PR, showing that another migration is already on main. But due to node-pg-migrate's format, git does not detect this as a conflict.

Suggested solution

I can see a couple of ways to fix this:

  • Instead of timestamps and names, the migration filenames should be simple counters, like 1.sql, 2.sql, ...
  • There should be a file listing the canonical order of migrations, so there's a conflict at the end

Does node-pg-migrate have any support for this?

Alternative

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions