-
Notifications
You must be signed in to change notification settings - Fork 382
task: Rename eventProperty to eventField [DHIS2-18549] #19373
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
...e-tracker/src/main/java/org/hisp/dhis/tracker/export/event/DefaultEventChangeLogService.java
Outdated
Show resolved
Hide resolved
...e-tracker/src/main/java/org/hisp/dhis/tracker/export/event/DefaultEventChangeLogService.java
Outdated
Show resolved
Hide resolved
...e-tracker/src/main/java/org/hisp/dhis/tracker/export/event/DefaultEventChangeLogService.java
Outdated
Show resolved
Hide resolved
| @@ -0,0 +1,3 @@ | |||
| -- DHIS2-18549 | |||
|
|
|||
| alter table eventchangelog rename eventproperty to eventfield; No newline at end of file | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we have not released v42, can we include this change to the original migration script and remove this script?
Instead of first creating something else and then altering it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What you are proposing would cause issues on play dev as the we would change the checksum of a migration that ran already. We would need to fix that manually AFAIK.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is not released, but it's been in master for a few days now.
I guess some people will have pulled from it already, if I use the original migration script, won't it create a conflict in Flyway for these people?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would create some conflicts yes. For devs who already have applied the old migration, they will have to either manually fix it or start from an older snapshot.
I doubt it would be an issue in play dev, as that always uses a db snapshot from a while ago. Possibly v41 db snapshot. We also have the flyway repair option in dhis config to make the fixes slightly easier. For master play dev, I think we do have flyway repair always set to true (I think).
Main intention for this suggestion is to avoid these developmental evolution "within a release" forced onto production migrations.
It is better we take some developer convenience hit, rather than having more steps in the migration process than needed. Imagine the table already having millions of entries after the original migration, and in this second migration, we do something extra in that large table which could have been combined in the original migration.
Either way, my feeling is to fix (and communicate to devs how to fix) the conflicts for this. What do you think? I could be convinced otherwise :D
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I get the concern about adding more steps to the migration, but isn’t it pretty much transparent to the implementations? They’d just update to v42, and Flyway would handle the updates automatically. Whether it’s all in one script or split into a few shouldn’t really matter to them.
I see your point of view and would agree if the second script was performing an operation on the data, such as adding a new column to an existing index or modifying the data in some significant way. However, in this case, it's simply renaming a column. Even if the table contains millions of entries, the execution time should stay the same.
Would you agree?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To clarify, I was not suggesting to add a "Alter table rename..." to the original migration script. Rather change the create table script to have the correct column names the first time.
Whether it’s all in one script or split into a few shouldn’t really matter to them.
It will matter to them if we do split migrations would cost more time right? It may not be significant for this case though. Since the renaming column is potentially a constant time operation. But that constant time is still an additional time. If the original query, when creating the table the first time, if it had the right column names, this renaming wouldn't have been necessary.
In this case though, assuming (and hoping) the additional time is very very small, let us go with this separate step 👍 😄
...e-tracker/src/main/java/org/hisp/dhis/tracker/export/event/DefaultEventChangeLogService.java
Outdated
Show resolved
Hide resolved
| @@ -0,0 +1,3 @@ | |||
| -- DHIS2-18549 | |||
|
|
|||
| alter table eventchangelog rename eventproperty to eventfield; No newline at end of file | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What you are proposing would cause issues on play dev as the we would change the checksum of a migration that ran already. We would need to fix that manually AFAIK.
|



As agreed on slack, I'm renaming
eventPropertytoeventField, to align with our current behavior in the API.