Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dry run migrations. #50

Open
igalklebanov opened this issue Jun 27, 2024 · 1 comment
Open

Dry run migrations. #50

igalklebanov opened this issue Jun 27, 2024 · 1 comment
Labels
enhancement New feature or request migrate Migrate module related

Comments

@igalklebanov
Copy link
Member

igalklebanov commented Jun 27, 2024

Hey 👋

What if we could dry-run migrations?

@igalklebanov igalklebanov added enhancement New feature or request migrate Migrate module related labels Jun 27, 2024
@shane-js
Copy link

shane-js commented Jun 28, 2024

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:

  • first_name varchar(255) ✏️ varchar(1000)
  • midd1e_name varchar(1000) -> ❌
  • middle_name varchar(1000) -> ✅

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request migrate Migrate module related
Projects
None yet
Development

No branches or pull requests

2 participants