Squashing AdonisJS Migrations: A Tool I Built
dev.toΒ·2hΒ·
Discuss: DEV
🦭Podman
Preview
Report Post

The Problem

After years of development, AdonisJS projects often accumulate hundreds of migration files:

  • 🐌 Slow fresh deployments (running 100+ migrations)
  • πŸ“‚ Cluttered migration folders
  • πŸ” Hard to understand current schema
  • 🧹 No official way to consolidate like Django’s squashmigrations

The Solution

I built adonis-lucid-migration-squash to solve this!

What it does:

Takes your PostgreSQL schema dump and converts it to a clean, single Knex migration with:

  • βœ… Smart enum detection
  • βœ… Proper foreign keys & constraints
  • βœ… Automated verification
  • βœ… Complete up() and down() methods

Quick Start:

# 1. Dump your production schema
pg_dump -s --no-owner --no-acl > schema.sql

# 2. C...

Similar Posts

Loading similar posts...

Keyboard Shortcuts

Navigation
Next / previous item
j/k
Open post
oorEnter
Preview post
v
Post Actions
Love post
a
Like post
l
Dislike post
d
Undo reaction
u
Recommendations
Add interest / feed
Enter
Not interested
x
Go to
Home
gh
Interests
gi
Feeds
gf
Likes
gl
History
gy
Changelog
gc
Settings
gs
Browse
gb
Search
/
General
Show this help
?
Submit feedback
!
Close modal / unfocus
Esc

Press ? anytime to show this help