-
Notifications
You must be signed in to change notification settings - Fork 70
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
feature request for generating flyway SQLs (edge case?) #955
Comments
Did we ever consider adding SQL support (mergers)? |
Somehow related to #860. Several user have asked me why CobiGen does not generate SQL files. I think this could be a good opportunity to add this.
No as far as I know, maybe @maybeec can shed some light in here.
I also agree that this is very tricky. In my opinion, we should implement some naive solutions because it seems too much efforts for following properly the devon4j SQL naming conventions. My naive solution would be:
|
BTW: I could easily provide my little work for #860 that I already did. |
Okay, I agree.
Yes, from our user's point of view this makes more sense. The only thing I'm not very convinced about are timestamps. My concerns are:
I think I would leave the file name decision to the user. What I mean is, let's generate an SQL with a big sequence value like |
This is quite strange. I would have thought that this makes more trouble as you might end up in execution of your SQLs in a non-intended sequence in case of merging brings up a maybe related sql script, which does not break but changes another sql script added to the top.
There was no intention to do so. Hibernate brings SQL generators for each SQL dialect. |
Stale topic. Please negotiate closing or discussing the relevance of this ticket. |
I created CobiGen templates to generate Flyway SQLs and therefore facing several edge cases that I could not solve with CobiGen:
According to our conventions the result must be generated into:
src/main/resources/db/migration/«version»/V«sequence»__«description».sql
While I can easily use static parts and variables to build
«description»
for my demands, I fail to fill the other two placeholders:«version»
would be extremely tricky to figure out: actually it IMHO needs to be the first two digits of the version number from the current POM (so in case of1.2.3-alpha1-SNAPSHOT
it would be1.2
.)«sequence»
would be the next available sequence number so requires to scan for all existignVxxxx__*
files and get the maximum + 1.Please also note that we could change the guidelines in devon4j to switch from sequnces to timestamps for flyway SQLs. We already got feedback from a project that this would be best practice also for merging feature branches, but we never catched this up. Then IMHO it would be relatively easiy but IMHO still cobigen does not yet support a current timestamp variable.
I just want to open this discussions for us to plan and think beyond. I am not requesting these enhancements now and am entirely open to reject them as well to consider them.
The text was updated successfully, but these errors were encountered: