iTop icon indicating copy to clipboard operation
iTop copied to clipboard

feat(ModuleInstaller): Add method to rename tables in the DB

Open Hipska opened this issue 1 year ago • 1 comments

Base information

Question Answer
Related to a SourceForge thead / Another PR / Combodo ticket? N/A
Type of change? Enhancement

Objective

To have a helper method that can rename a table in DB during setup. The helper method can silently ignore the renaming if the origin table doesn't exist or the destination table already exists. This to avoid errors when running the setup again after the migration has ben done before.

Proposed solution

Creation of ModuleInstallerAPI::MoveColumnInDB.

Checklist before requesting a review

  • [x] I have performed a self-review of my code
  • [x] I have tested all changes I made on an iTop instance
  • [x] I have added a unit test, otherwise I have explained why I couldn't
  • [x] Is the PR clear and detailled enough so anyone can understand digging in the code?

Hipska avatar Feb 28 '24 12:02 Hipska

Okay @Molkobain, but earlier you said this:

So it's best to revert the table to its original state in order to keep it clean for other tests. Moving the revert in the teardown method would not pollute other test classes, but it would impact other tests from the current class.

So I understand that it might impact other tests and thus it needed to be added within the test?

About the exit conditions, I thought this was also discussed and agreed before?

Ok right, indeed there are only return in \ModuleInstallerAPI::MoveColumnInDB This method was added in 2018 so not to far away, it is quite a strange choice :/ To be discussed during next review !

Followed by

Closing conversation, we discussed during tech review and this is no longer valid.

Do I understand this wrong?

Hipska avatar May 13 '24 14:05 Hipska

@Molkobain?

Hipska avatar Jul 10 '24 08:07 Hipska

Hello Thomas, nevermidn about the revert table comment, leave it as it is. Just missing the SetupLog messages, then alright for me. :)

Molkobain avatar Jul 16 '24 07:07 Molkobain

Thanks!

Molkobain avatar Jul 16 '24 20:07 Molkobain

Done, thanks a lot Thomas!

Molkobain avatar Jul 24 '24 08:07 Molkobain