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

Using dot in major version creates extension bug and fake version in table #37

Closed
billonalex opened this issue Dec 14, 2023 · 6 comments
Assignees
Labels
bug Something isn't working enhancement New feature or request

Comments

@billonalex
Copy link

Hello,

I'm trying to integrate pyway in a project which needs SQL migration.

I am trying to integrate files with patterns like : V5.0_01__initial_schema.sql
However, the version in pyway schema table gives me : 0.01... I would need it to be 5.0.01 ({major}.{minor}). If I write a dot in major version (ex: V5.0), it seems the extension is not SQL anymore, but the name of the script (in my case : 0_01__INITIAL_SCHEMA)...

Capture d’écran 2023-12-14 à 15 50 49

Could you please look to consider this evolution ?
Thank you 🙂

@jasondcamp
Copy link
Owner

jasondcamp commented Dec 14, 2023

Just to clarify, do you mean you'd like it to support semantic versioning? Or you'd like to support the ability to have dots in the name itself? I could just disallow dots from the regexp but I'd prefer to support what you're trying to do.

@billonalex
Copy link
Author

Both would be great. It would be useful for my case to use dots in major version (ex: 5.0) and with the minor version of the script it will make a version 5.0.01 in the table (so semantic version).
I think (but I may be wrong) just disallowing dots in the regexp for the major version would be enough to do what I try to do, am I wrong ?

@jasondcamp
Copy link
Owner

great thanks for the info, I'll work on this!

@jasondcamp
Copy link
Owner

jasondcamp commented Dec 15, 2023

I added the ability to use dots in the major and minor versions, added support for semantic versioning in general, and added all of the needed tests around it. You can also use either periods or underscores to separate the major/minor/patch versions.
Hopefully this should do the trick, please let me know if you run into any issues.

@billonalex
Copy link
Author

Just tested the feature with 0.3.21, it works perfectly.

Great thanks to you for your work, it will be very useful for me 😃

@jasondcamp
Copy link
Owner

Awesome great to hear!!! Please let me know if you run into any other issues while using, I appreciate it!.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants