How to Squash Migrations?
Squashing Migrations is a time-honored practice in many ORM-adjacent systems. Examples could be on Django SO in 2016, 2017, 2020, or even the official documentation, and similar tooling in other language ecosystems, e.g. Ruby's squasher. I can't find anything about it for DrizzleKit. Has anyone done this? Is there a blog post I missed?
Stack Overflow
How to squash recent Django migrations?
In Django's migrations code, there's a squashmigrations command which: "Squashes the migrations for app_label up to and including migration_name down into fewer migrations, if possible."
So, if yo...
Stack Overflow
How to squash all migration files in to one in django?
I have 82 migration files in my django app. Some of them are related to removed models. I want to merge all these 82 migration files into one migration file.
How do I do without deleting the datab...
Stack Overflow
Best way to squash migrations django
I had 10 migrations and I wanted to keep them in one file . So I squash them using ./manage.py squashmigrations accounts . Now I had 11 files including init and squash file. so I deleted 9 ot...
2 Replies
Indeed, searching this discord for "squash" has zero hits 🥹
✨ Solution! ✨
My scripts:
My
src/lib/db/setup.server.ts
is in this gist: https://gist.github.com/pboling/f831235a1f3c5627f0341c4bbcf37ea9#file-setup-server-tsGist
Squash PostgreSQL Migrations with drizzle-kit and pgtools
Squash PostgreSQL Migrations with drizzle-kit and pgtools - setup.server.ts