-
Notifications
You must be signed in to change notification settings - Fork 225
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
feat(ModuleInstaller): Add method to rename tables in the DB #623
base: support/3.2
Are you sure you want to change the base?
feat(ModuleInstaller): Add method to rename tables in the DB #623
Conversation
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.
See comment on test
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.
Great work, thanks !
My remarks are mostly questions, and also we may add more uses cases in the phpunit
* @throws \CoreException | ||
* @throws \MySQLException | ||
*/ | ||
public function testRenameTableInDB() |
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 would also test :
- orig and dest on the same existing table name
- orig and dest on the same non existing table name
- orig on a non existing table name
- dest on an existing table name
This may be easier to code using a dataprovider returning orig and dest names, and expected result ?
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.
Technical review:
- Unit test:
- Move table revert in tearDown() method for better robustness in case there is an issue within the test method
- New method:
- Add
SetupLog
message in exit conditions (except the!MetaModel::DBExists(false)
). SeeRenameEnumValueInDB()
for a real example,MoveColumnInDB()
is a bad one.
- Add
Okay @Molkobain, but earlier you said this:
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?
Followed by
Do I understand this wrong? |
Hello Thomas, nevermidn about the revert table comment, leave it as it is. |
Thanks! |
c4450d9
to
8662a5b
Compare
8662a5b
to
c4450d9
Compare
c4450d9
to
f91ca34
Compare
Base information
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.EDIT: This part has been rejected by Combodo technical review..
Proposed solution
Creation of
ModuleInstallerAPI::RenameTableInDB
.Checklist before requesting a review