-
-
Notifications
You must be signed in to change notification settings - Fork 386
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
Do not create schema to see if the migrations table exists. #94
Conversation
Do not create schema to see if the migrations table exists.
This commit breaks Migrations for postgresql users with a schema-specific migrations table. I do not have a public schema in my postgresql database and my migrations table is specified as "schema_name.doctrine_migrations_table". This worked fine until this commit was merged. The change to |
I see if i can get pg up and running and figure something out.. have some "issues" with my PG install. getting "PDOException: SQLSTATE[08006] [7] FATAL: sorry, too many clients already" and have not investigated what going on. Installed with macports. Any good idea's. I will try to fix the bug. |
@rhunwicks what version of dbal are you using ? |
|
Further investigation shows the problem is with If the schema for the table is the same as the first schema in the search path, then it returns the bare table name without a schema qualifier. This seems fine in general, but when we call |
also why im looking into maybe using listTableColumns or some other direct call to the db if possible. Havent tested it yet tho. Just an idea. That or go back to the super slow createSchema |
The least intrusive way, given the error is a result of the definition of /**
* Return true if all the given tables exist.
*
* @param array $tableNames
* @return bool
*/
public function tablesExist($tableNames)
{
foreach ($tableNames as $key => $tableName) {
if (strpos($tableName, '.') !== false) {
$tableName = explode('.', $tableName, 2);
$tableNames[$key] = $this->_getPortableTableDefinition(array('schema_name'=>$tableName[0], 'table_name'=>$tableName[1]));
}
}
return parent::tablesExist($tableNames);
} |
Think i add some unit tests to tests this for each db. I never been a big user of PG or.. other dbs then mysql. Something i will change soonish... |
I think this issue should be reopened - as the current situation will break Migrations for some Postgresql users the next time they do a |
@rhunwicks This is a PR, not an issue. So we cannot reopen it as it has been merged. If there is an issue, pleas eopen a dedicated ticket instead of using comments on a merged PR. |
I will post a fix later today you can test out for me. |
Sorry for the extra changed lines.