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

Use relative migration filename #122

Open
jdachtera opened this issue Oct 1, 2024 · 2 comments · May be fixed by #123
Open

Use relative migration filename #122

jdachtera opened this issue Oct 1, 2024 · 2 comments · May be fixed by #123

Comments

@jdachtera
Copy link

Hi @mycodeself,

Thank you for creating this library—it's been very helpful.

I noticed that the absolute filename of a migration is currently saved to the database. This setup means a rollback can only be performed from the same machine that executed the migration, or one with a similar directory structure.

Wouldn't it be more flexible to store the path relative to migrationsDir? This change would allow rollbacks from any machine. If you're open to PRs, I’d be happy to contribute one.

Thanks for considering this improvement.

Cheers,
@jdachtera

@mycodeself
Copy link
Owner

Hello @jdachtera,

I think you are totally right and this is a design flaw I made. The only thing that worries me a bit about this change is that it will be a breaking change, no?

Maybe we can implement a command to migrate the paths and make it easier for users, WDYT?

Thanks a lot for your help 😃

@jdachtera
Copy link
Author

Yeah, I think implementing that command is a great idea. I've opened a pull request which implements the changes here: #123. I'm currently looking into the tests now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants