Skip to content

lint duplicate migration numbers before merge and in main #215

Open
@dannykopping

Description

@dannykopping

Exhibit A: coder/coder#15530

coder/coder#15448 was merged after coder/coder#15502, and both contained the same migration number. This passed all checks, and when we auto-deployed main to our dogfood environment we encountered a fatal error on startup:

Encountered an error running "coder server", see "coder server --help" for more information
error: connect to postgres:
    github.com/coder/coder/v2/cli.(*RootCmd).Server.func2
        /home/runner/work/coder/coder/cli/server.go:704
  - connect to postgres:                                                                                                                                                              
    github.com/coder/coder/v2/cli.getPostgresDB
        /home/runner/work/coder/coder/cli/server.go:2625
  - migrate up:                                                                                                                                                                       
        /home/runner/work/coder/coder/cli/server.go:2206
  - migrate setup:                                                                                                                                                                    
        /home/runner/work/coder/coder/coderd/database/migrations/migrate.go:116
  - create iofs:                                                                                                                                                                      
        /home/runner/work/coder/coder/coderd/database/migrations/migrate.go:82      
  - failed to init driver with path .: duplicate migration file: 000274_rename_user_link_claims.down.sql

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