Add Migration Squashing / Schema Baseline Support #12878
KevinSkayro
started this conversation in
Feature Requests & Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
We're preparing our Payload project for production, and we've accumulated a large number of development migrations. Before launching, we want to squash these into a single baseline migration that represents our current schema — then begin tracking new schema changes with clean migration history post-launch.
This is a common step in other frameworks:
Laravel has
php artisan schema:dump
Prisma supports
migrate diff + resolve --applied
These allow teams to discard noisy dev migrations and start from a clean baseline when going live.
Here a reference of what I mean in
Laravel
: https://laravel.com/docs/12.x/migrations#squashing-migrationsWould be great to see a built-in CLI command like
payload migrate:squash
orschema:baseline
to help with this!I think this could be a nice feature for Payload, is this something the Payload Team considered?
If this already exists, feel free to drop it, I could not find anything on it.
Beta Was this translation helpful? Give feedback.
All reactions