Netlify Database migration marked Pending by CLI but Applied by deploy checksum

Site: preeminent-gumdrop-2d59d1.netlify.app

Project ID:
44f6c59c-8ba0-43e3-b4c5-a92e26382ad7

Database branch:
production

Git branch:
main

Netlify CLI:
27.8.0

I am experiencing an inconsistent Netlify Database migration state on the production branch.

Affected migration:
20260914064559_seed-initial-azul-stores-roles-and-permissions

Background:

The migration originally contained explicit BEGIN/COMMIT statements.

A production deployment attempted to execute it and failed with:

Database migration failed: error running migrations: committing migrations: pq: unexpected transaction status idle

Deploy ID:
6aa7a16f2ef630681b973b1c

The BEGIN/COMMIT statements were subsequently removed from the migration because Netlify manages the migration transaction.

A later production deployment then failed with:

Database migration failed: migration “20260914064559_seed-initial-azul-stores-roles-and-permissions” has been modified after being applied

Deploy ID:
6aab7fe6df59a94f5fd154d9

The current state appears inconsistent:

  1. netlify database status --branch production reports only 001_azul_production_schema as Applied.

  2. It reports 20260914064559_seed-initial-azul-stores-roles-and-permissions as Pending.

  3. netlify database migrations pull --branch production pulls only 001_azul_production_schema. It does not pull the seed migration.

  4. netlify database status --branch production --json also reports the seed as Pending, with:

    • missingOnDisk: []
    • outOfOrder: []
  5. However, the production database contains all data written by the seed:

    • 3 stores: MATRIZ, ROBERTO, GEO
    • 9 roles: ADMIN_GENERAL, ADMIN_TIENDA, SUPERVISOR, OPERATIVO, COMPRAS_CATALOGO, SUPERVISOR_MAYOREO, CHECADOR_MAYOREO, CLIENTE, PROVEEDOR
  6. Despite the CLI considering the migration Pending, the production deploy runner considers it previously applied and rejects the changed checksum.

For reference, the SHA-256 hashes are:

Original migration (with BEGIN/COMMIT):
efd399310c31eaf26ed59493a7a2607d74a54b480baf1a7467bc9f582178412d

Current migration (without BEGIN/COMMIT):
952b00db534537d34e00e74487d01744e51c1ec0c2d9f0ec3d280163e7868926

I have stopped further production deployments and have not manually modified Netlify migration metadata.

Could a Netlify Support or Database engineer please inspect the migration metadata/checksum state for the production database branch and advise the safe way to reconcile it?

My priority is to preserve the existing production schema and data and restore a consistent migration history before performing any further production deployments.

I can provide additional deployment logs if required.