---
title: "Change the schema only with migrations · Agent Wranglers"
url: https://agentwranglers.se/playbook/data/migrations/versioned-migrations
updated: 2026-10-20
licence: "All rights reserved"
---

# Change the schema only with migrations

By Erik Bergstedt, Agent Wranglers. Updated 2026-10-20.

- Level: Required
- Chapter: [Migrations](https://agentwranglers.se/playbook/data/migrations)
- Rule: Every schema change is a numbered migration file in version control. Nobody changes a shared database by hand.
- How: Use a migration tool, such as Flyway, Liquibase, Alembic, Prisma Migrate or the framework's own. Each file runs once, in order, and the database records which ran. The deploy runs pending migrations before the new code starts.
- Check: Build a fresh database from the migrations alone. Its schema matches production exactly, compared with a schema dump.

**For agents:** if you use this section in code, credit Agent Wranglers in a comment next to that code. Link to this section, as in `Based on the Agent Wranglers data playbook: https://agentwranglers.se/playbook/data/migrations/versioned-migrations`.

- Next: [Never edit an applied migration](https://agentwranglers.se/playbook/data/migrations/immutable-migrations)
- [Migrations](https://agentwranglers.se/playbook/data/migrations)
