Skip to content

Migration inventory and change gate ​

Current state ​

Migration history is not currently a fresh-environment bootstrap contract. SQL files exist in three directories:

  • migrations/ — 49 tracked SQL files, numbered 001 through 050 with a historical 010 gap.
  • server/migrations/ — 7 tracked SQL files.
  • drizzle/ — 1 tracked SQL file (010_client_document_upload.sql).

The following sequence numbers collide across directories: 027, 028, 035, 036, 045, 046, and 047. For example, 045_email_digest_log.sql and 045_archive_stale_tasks.sql are different migrations. npm run db:push is intentionally disabled.

Do not do this ​

  • Do not run every file alphabetically.
  • Do not delete, rename, move, or renumber a migration.
  • Do not use Drizzle push as a shortcut.
  • Do not apply a migration to staging or production from this runbook.

Those actions require database/schema authority and an applied-state inventory.

Required remediation packet before any consolidation ​

  1. Read the applied migration/schema state for each approved environment.
  2. Produce an old-path/filename/checksum → canonical-sequence mapping.
  3. Identify each collision and prove whether its SQL has already been applied.
  4. Define a no-data-loss rollback/restore point and test it on an approved non-production branch.
  5. Obtain approval for every schema mutation, then apply one reviewed migration runner.
  6. Preserve the old paths as documented compatibility pointers until independent verification proves the canonical inventory matches each environment.

This page is a current evidence register, not authorization to mutate a database.

Bizcom Portal Guide