"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "framework/db/mysql/Schema.php" between
yii2-2.0.35.tar.gz and yii2-2.0.36.tar.gz

About: Yii 2 is a high-performance component-based PHP framework for developing large-scale Web applications (source).

Schema.php  (yii2-2.0.35):Schema.php  (yii2-2.0.36)
skipping to change at line 514 skipping to change at line 514
`kcu`.`REFERENCED_TABLE_NAME` AS `foreign_table_name`, `kcu`.`REFERENCED_TABLE_NAME` AS `foreign_table_name`,
`kcu`.`REFERENCED_COLUMN_NAME` AS `foreign_column_name`, `kcu`.`REFERENCED_COLUMN_NAME` AS `foreign_column_name`,
`rc`.`UPDATE_RULE` AS `on_update`, `rc`.`UPDATE_RULE` AS `on_update`,
`rc`.`DELETE_RULE` AS `on_delete`, `rc`.`DELETE_RULE` AS `on_delete`,
`kcu`.`ORDINAL_POSITION` AS `position` `kcu`.`ORDINAL_POSITION` AS `position`
FROM FROM
`information_schema`.`KEY_COLUMN_USAGE` AS `kcu`, `information_schema`.`KEY_COLUMN_USAGE` AS `kcu`,
`information_schema`.`REFERENTIAL_CONSTRAINTS` AS `rc`, `information_schema`.`REFERENTIAL_CONSTRAINTS` AS `rc`,
`information_schema`.`TABLE_CONSTRAINTS` AS `tc` `information_schema`.`TABLE_CONSTRAINTS` AS `tc`
WHERE WHERE
`kcu`.`TABLE_SCHEMA` = COALESCE(:schemaName, DATABASE()) AND `kcu`.`CONSTRAI `kcu`.`TABLE_SCHEMA` = COALESCE(:schemaName1, DATABASE()) AND `kcu`.`CONSTRA
NT_SCHEMA` = `kcu`.`TABLE_SCHEMA` AND `kcu`.`TABLE_NAME` = :tableName INT_SCHEMA` = `kcu`.`TABLE_SCHEMA` AND `kcu`.`TABLE_NAME` = :tableName
AND `rc`.`CONSTRAINT_SCHEMA` = `kcu`.`TABLE_SCHEMA` AND `rc`.`TABLE_NAME` = AND `rc`.`CONSTRAINT_SCHEMA` = `kcu`.`TABLE_SCHEMA` AND `rc`.`TABLE_NAME` =
:tableName AND `rc`.`CONSTRAINT_NAME` = `kcu`.`CONSTRAINT_NAME` :tableName1 AND `rc`.`CONSTRAINT_NAME` = `kcu`.`CONSTRAINT_NAME`
AND `tc`.`TABLE_SCHEMA` = `kcu`.`TABLE_SCHEMA` AND `tc`.`TABLE_NAME` = :tabl AND `tc`.`TABLE_SCHEMA` = `kcu`.`TABLE_SCHEMA` AND `tc`.`TABLE_NAME` = :tabl
eName AND `tc`.`CONSTRAINT_NAME` = `kcu`.`CONSTRAINT_NAME` AND `tc`.`CONSTRAINT_ eName2 AND `tc`.`CONSTRAINT_NAME` = `kcu`.`CONSTRAINT_NAME` AND `tc`.`CONSTRAINT
TYPE` = 'FOREIGN KEY' _TYPE` = 'FOREIGN KEY'
UNION UNION
SELECT SELECT
`kcu`.`CONSTRAINT_NAME` AS `name`, `kcu`.`CONSTRAINT_NAME` AS `name`,
`kcu`.`COLUMN_NAME` AS `column_name`, `kcu`.`COLUMN_NAME` AS `column_name`,
`tc`.`CONSTRAINT_TYPE` AS `type`, `tc`.`CONSTRAINT_TYPE` AS `type`,
NULL AS `foreign_table_schema`, NULL AS `foreign_table_schema`,
NULL AS `foreign_table_name`, NULL AS `foreign_table_name`,
NULL AS `foreign_column_name`, NULL AS `foreign_column_name`,
NULL AS `on_update`, NULL AS `on_update`,
NULL AS `on_delete`, NULL AS `on_delete`,
`kcu`.`ORDINAL_POSITION` AS `position` `kcu`.`ORDINAL_POSITION` AS `position`
FROM FROM
`information_schema`.`KEY_COLUMN_USAGE` AS `kcu`, `information_schema`.`KEY_COLUMN_USAGE` AS `kcu`,
`information_schema`.`TABLE_CONSTRAINTS` AS `tc` `information_schema`.`TABLE_CONSTRAINTS` AS `tc`
WHERE WHERE
`kcu`.`TABLE_SCHEMA` = COALESCE(:schemaName, DATABASE()) AND `kcu`.`TABLE_NA `kcu`.`TABLE_SCHEMA` = COALESCE(:schemaName2, DATABASE()) AND `kcu`.`TABLE_N
ME` = :tableName AME` = :tableName3
AND `tc`.`TABLE_SCHEMA` = `kcu`.`TABLE_SCHEMA` AND `tc`.`TABLE_NAME` = :tabl AND `tc`.`TABLE_SCHEMA` = `kcu`.`TABLE_SCHEMA` AND `tc`.`TABLE_NAME` = :tabl
eName AND `tc`.`CONSTRAINT_NAME` = `kcu`.`CONSTRAINT_NAME` AND `tc`.`CONSTRAINT_ eName4 AND `tc`.`CONSTRAINT_NAME` = `kcu`.`CONSTRAINT_NAME` AND `tc`.`CONSTRAINT
TYPE` IN ('PRIMARY KEY', 'UNIQUE') _TYPE` IN ('PRIMARY KEY', 'UNIQUE')
ORDER BY `position` ASC ORDER BY `position` ASC
SQL; SQL;
$resolvedName = $this->resolveTableName($tableName); $resolvedName = $this->resolveTableName($tableName);
$constraints = $this->db->createCommand($sql, [ $constraints = $this->db->createCommand($sql, [
':schemaName' => $resolvedName->schemaName, ':schemaName' => $resolvedName->schemaName,
':schemaName1' => $resolvedName->schemaName,
':schemaName2' => $resolvedName->schemaName,
':tableName' => $resolvedName->name, ':tableName' => $resolvedName->name,
':tableName1' => $resolvedName->name,
':tableName2' => $resolvedName->name,
':tableName3' => $resolvedName->name,
':tableName4' => $resolvedName->name
])->queryAll(); ])->queryAll();
$constraints = $this->normalizePdoRowKeyCase($constraints, true); $constraints = $this->normalizePdoRowKeyCase($constraints, true);
$constraints = ArrayHelper::index($constraints, null, ['type', 'name']); $constraints = ArrayHelper::index($constraints, null, ['type', 'name']);
$result = [ $result = [
'primaryKey' => null, 'primaryKey' => null,
'foreignKeys' => [], 'foreignKeys' => [],
'uniques' => [], 'uniques' => [],
]; ];
foreach ($constraints as $type => $names) { foreach ($constraints as $type => $names) {
foreach ($names as $name => $constraint) { foreach ($names as $name => $constraint) {
 End of changes. 4 change blocks. 
12 lines changed or deleted 18 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)