Skip to content

Commit

Permalink
Improving performance when quering information_schema
Browse files Browse the repository at this point in the history
  • Loading branch information
darxmac committed Sep 16, 2014
1 parent 6e8f607 commit 1b1a0db
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Database/Schema/MysqlSchema.php
Expand Up @@ -213,9 +213,9 @@ public function describeForeignKeySql($tableName, $config) {
$sql = 'SELECT * FROM information_schema.key_column_usage AS kcu
INNER JOIN information_schema.referential_constraints AS rc
ON (kcu.CONSTRAINT_NAME = rc.CONSTRAINT_NAME)
WHERE kcu.TABLE_SCHEMA = ? AND kcu.TABLE_NAME = ?';
WHERE kcu.TABLE_SCHEMA = ? AND kcu.TABLE_NAME = ? and rc.TABLE_NAME = ?';

return [$sql, [$config['database'], $tableName]];
return [$sql, [$config['database'], $tableName, $tableName]];
}

/**
Expand Down

0 comments on commit 1b1a0db

Please sign in to comment.