kysely-org / kysely-ctl

Command-line tool for Kysely
MIT License
44 stars 1 forks source link

Dry run migrations. #50

Open igalklebanov opened 1 week ago

igalklebanov commented 1 week ago

Hey 👋

What if we could dry-run migrations?

shane-js commented 1 week ago

So awesome to see this presented as a possibility after our talk yesterday. I'll share what I wrote there:

[Without this my] current thought is the only way to test is by wiping the DB completely (or point to a different one) and re-backing it up to compare the schema of the rewritten kysely migration to the original schema created by the knex migration.

I've always longed for something like Entity Framework how it can compare and show diffs before executing.

Although I am guessing technically this would only be possible incrementally with each currently unrun migration file - it would be insanely great if it could output what the final diffs would be after all migrations something like (example of edit column, delete column, and insert column only others would need thought out):

UserTable:

I honestly think something like this would be extremely well received and attract a lot of people to this tech if it could be figured out.