-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
HHH-18784 TableMigrator shouldn't alter column length if length is not explicitly-set #9189
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
Conversation
|
@gavinking WDYT? |
I'm not sure I agree with the concept. We don't recommend running In that context I would say it would be annoying if adding But, well, this merits further discussion. |
It's annoying development too, It's kind of regression because I can do that in early version. |
|
I don't see how it can be annoying in development. Why would you want to develop against a schema that disagrees with what you have explicitly specified in your mapping annotations? If there is disagreement there, I would want to know about it! |
I didn’t specify @column explicitly, the length defaults to 255 |
|
Perhaps we should check the required length is default length |
Yeah, I was wondering that too. Actually, @sebersole, I believe we now have ways to distinguish an unset/defaulted length from an explicitly-set |
@gavinking Please review the updated PR, column will not be modified if |
I inspected |
|
|
||
| @Before | ||
| public void setUp() throws IOException { | ||
| output = File.createTempFile( "update_script", ".sql" ); |
Check warning
Code scanning / CodeQL
Local information disclosure in a temporary directory Medium test
No, I initially did, when using Jandex (which does understand this distinction). But everyone else disagreed with that so I rempoved it. |
|
Well, OK, then, given that we can't distinguish an explicit |
The problem is the same. We don't know which values are explicit (again, unless using Jandex). Java makes default and eplicit values indistinguishable. |
|
Rejecting this one |
I think this PR is worthy to merge, It distinguish |
|
@quaff We never treat a missing annotation as different to a missing annotation member for the JPA mapping annotations. |
I agree that, but I'm requesting special treat for schema migration here, the unit tests in this PR should pass. |
|
And that's precisely the sort of ad hoc hacked-in special case which I'm thoroughly against. How am I supposed to explain to a user that "oh, it behaves one way with the Again, schema migration is a limited tool with very limited capabilities, which is supposed to assist at development time. It's not a replacement for something like Flyway or whatever, and we've never promoted it as such. |
[Please describe here what your change is about]
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license
and can be relicensed under the terms of the LGPL v2.1 license in the future at the maintainers' discretion.
For more information on licensing, please check here.
https://hibernate.atlassian.net/browse/HHH-18784