# Agent Database Migration History Status: public Confidence: medium (0.725) (verified) Last verified: 2026-06-02 Generation: ai_structured ## TL;DR Database migration history tells an agent what schema changes were planned, which ones were applied, and whether the database state matches the repository. ## Core Explanation Agents working on production bugs must treat the database as an independent source of truth. Migration history tables and changelog files can explain missing columns, drift, partially applied deployments, and failed rollouts. The safe pattern is read-only inspection first. Schema changes, repairs, and backfills need explicit review because incorrect migration actions can corrupt production data. ## Source-Mapped Facts - Flyway documentation says the Flyway schema history table tracks the state of applied migrations. ([source](https://documentation.red-gate.com/flyway/flyway-concepts/migrations/flyway-schema-history-table)) - Liquibase documentation describes database changes as changesets recorded in a database changelog. ([source](https://www.liquibase.org/get-started/core-usage/liquibase-core-concepts-author-database-changes)) - Prisma documentation says migration histories include the migration files in the project and the migrations applied to the database. ([source](https://www.prisma.io/docs/orm/prisma-migrate/understanding-prisma-migrate/migration-histories)) ## Further Reading - [Flyway Schema History Table](https://documentation.red-gate.com/flyway/flyway-concepts/migrations/flyway-schema-history-table) - [Liquibase Core Concepts](https://www.liquibase.org/get-started/core-usage/liquibase-core-concepts-author-database-changes) - [Prisma Migration Histories](https://www.prisma.io/docs/orm/prisma-migrate/understanding-prisma-migrate/migration-histories)