-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
WIP Added validation on exists database before created for MySQLi… #2100
Conversation
…d for MySQLi and Postgre
I like the code and concept but I'm not sure that the framework should just gloss over a logic error like creating a database that already exists, returning |
I agree with you. Framework must inform user about this error by default. |
Probably best to model it after the same feature on the
(Though by the style guide that should be camel case |
The User Guide will also need to be updated. |
Ok. |
Correct! Particularly you want user_guide_src/source/dbmgmt/forge.rst |
Thank you! |
This is looking pretty good. We'll need some tests - I think they should be relatively easy to copy the existing ones and add a few cases: tests/system/Database/Live/ForgeTest.php. Also your upstream merge wasn't signed - if you add GPG to the source of that commit it will retroactively add the verification, or you can redo it. |
Good, I'll add some test cases. |
6095474
to
c2699b5
Compare
@oleg1540 The additions look good, but now SQLite seems to be failing your tests because it cannot drop the database. |
Great! Thanks a lot. @lonnieezell or @jim-parry I believe this is ready to go, if you want to give it a glance first? |
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.
Just one nit-picky change requested. Other than that looks good.
At some point I feel we could probably get the SQLite tests here working by giving it a path, then checking if the file exists...
@lonnieezell Maybe dropDatabase() in these tests don't run if DbDriver == 'SQLite3'? So we can check createDatabese function, dropDatabase() function is optional in these tests. |
@oleg1540 What error were you hitting when running the tests with Looking at the logic in those tests it first creates the database (which creates a file). After getting the response from that it drops the database (which should only throw an exception if the file doesn't exist - but we just created it so it should). Seems like it should work. |
@lonnieezell At first I didn't write any limitations for these tests. But tests failed on SQLite3 driver with error
So I disabled it for SQLite3 driver.
I agree with you. You offer to add |
Well - what I was getting at is that it would be nice to get to the bottom of why it couldn't drop the database and go from there. If it's something that we can't easily fix that only happens at Travis then I have no problems skipping the test. But if it's something we can fix we should fix it. |
@lonnieezell Method createDatabase for SQLite3 always return true, because
and database would be named as |
I'm going to go ahead and merge this for now. We can revisit the skipped SQLite tests at a later date if desired. |
Description
#1759
Added validation on exists database before created for MySQLi and Postgre Forge Class.
Checklist: