Update scripts executed two times when change component order

Scenario:

1- Create a project with 2 components: CompBase, CompStatus;
2- Alter database or any entity, to generate and execute a script update. Will be create a scripts like: 10-cuba; 20-CompBase; 20- CompStatus; 30-MyProject;
3- Add the CompBase to the CompStatus as a component and release new version;
4- The scripts on the projetct will be created like 10-cuba; 20-CompBase; 30- CompStatus; 40-MyProject;
5- When execute the updateDb task will try to execute again, because the script name changed from ‘30-MyProject’ to ‘40-MyProject’

PS: It happened with me on a scenario with more than 10 components. The scenario above was descripted with only two components to test more easly.

Hi,
Unfortunately, I could not reproduce the problem.
‘UpdateDb’ should not consider the number-prefix when comparing the path with sys_db_changelog records. And 70-aggr/update/postgres/20/200226-2-updateAggEnt.sql will not be exected if exists the record “50-aggr/update/postgres/20/200226-2-updateAggEnt.sql”

Probably, I have missed something. Could you please, bring more details, maybe with screenshots?

Which version of Platform do you use in the projects?
How have you made the scripts starting from “20” (20-CompBase; 20- CompStatus; 30-MyProject)? Numbers 10-40 are reserved for Cuba, Reporting, BPM, Charts, and there should be “50-CompBase; 50- CompStatus; 60-MyProject”.

Really, I tried to explain a scenario to test more easily and the number-prefix are anothers. How I told you, in my scenario I have a lot of components, and not only 2 how I explained. I will try to generate a better example.

Hi @iskandarov,

I work with @cristiano.cordeiro07 and we are upgrading all our components and applications to cuba 7.2, and the same problem happened again. I’ll try to add more information to the thread, as this is a complex scenario (multiple components involved) and the problem happens when there is a change in their dependencies from one version to another.

This is the message that studio showed when I changed our component to the new version:
image

And this is the database query result:
image

So, I updated the script_name from 100-ComponenteMensageria* to 90-ComponenteMensageria*:
image

Query results after database update:
image

Now, studio is not complaining about unapplied scripts from our component anymore:
image

I hope it helps to identify the problem.

Regards,
Peterson.

Hi,
Thank you for the good issue description. We have reproduced it and created the YouTrack issue.
The problem occurs when the app-component numbering exceeds 100. I think it will be fixed soon.

Regards.

1 Like