|
|
|
@ -99,14 +99,14 @@ class QueryBuilder extends \yii\db\QueryBuilder
|
|
|
|
|
/** |
|
|
|
|
* Builds a SQL statement for enabling or disabling integrity check. |
|
|
|
|
* @param boolean $check whether to turn on or off the integrity check. |
|
|
|
|
* @param string $table the table name. Meaningless for MySQL. |
|
|
|
|
* @param string $schema the schema of the tables. Meaningless for MySQL. |
|
|
|
|
* @param string $schema the schema of the tables. |
|
|
|
|
* @param string $table the table name. |
|
|
|
|
* @return string the SQL statement for checking integrity |
|
|
|
|
*/ |
|
|
|
|
public function checkIntegrity($check = true, $schema = '', $table = '') |
|
|
|
|
{ |
|
|
|
|
$enable=$check ? 'ENABLE' : 'DISABLE'; |
|
|
|
|
$tableNames=$this->db->schema->findTableNames($schema); |
|
|
|
|
$enable = $check ? 'ENABLE' : 'DISABLE'; |
|
|
|
|
$tableNames = $table ? [$table] : $this->db->schema->findTableNames($schema); |
|
|
|
|
$command = ''; |
|
|
|
|
|
|
|
|
|
foreach($tableNames as $tableName) |
|
|
|
|