-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
[SQLite Platform] doctrine:database:create --if-not-exists fix #2402
[SQLite Platform] doctrine:database:create --if-not-exists fix #2402
Conversation
@@ -180,6 +180,14 @@ protected function _getTransactionIsolationLevelSQL($level) | |||
/** | |||
* {@inheritDoc} | |||
*/ | |||
public function getListDatabasesSQL() | |||
{ | |||
return 'PRAGMA databases'; |
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.
In sqlite the PRAGMA is "database_list" not "databases".
You will need to fix the tests and verify that the ouput of that PRAGMA is comparable to the output of the others platforms.
I tried fix it, basically PRAGMA database_list return array [see below] while database file been created in root directory (or in directory from tests been launched) whenever I launch it with command: test_create_database file been created in root, but
$databases content:
i presume it should detect test_create_database file , what I am doing wrong? I didn't catch =/ |
bump! |
@mikeSimonson seems you have more experience with SQLIte than me, can you please help? |
Any updates on this? It's still an issue |
{ | ||
$this->_sm->listDatabases(); | ||
} | ||
// /** |
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.
If it's dead, it should be removed
@@ -127,10 +127,13 @@ public function testListDatabases() | |||
|
|||
$this->_sm->dropAndCreateDatabase('test_create_database'); | |||
$databases = $this->_sm->listDatabases(); | |||
/** left for debug purposes */ |
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.
Remove - debugging stuff only while debugging please
$databases = array_map('strtolower', $databases); | ||
|
||
$this->assertContains('test_create_database', $databases); | ||
$this->assertContains('test_create_database', $databases_); |
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.
The return format of SchemaManager#listDatabases()
changed: that is a BC break.
|
||
$databases = array_map('strtolower', $databases); |
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.
Please DO ADD a test to demonstrate your issue, rather than modifying existing tests.
Closing, as author never got around to finish this. If you ever intend to finish this, feel free to open new PR. Thanks! |
problem description: doctrine/DoctrineBundle#542