|
|
@ -7,10 +7,10 @@ |
|
|
|
* @license http://www.yiiframework.com/license/ |
|
|
|
* @license http://www.yiiframework.com/license/ |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
|
|
namespace yii\db\dao\mysql; |
|
|
|
namespace yii\db\mysql; |
|
|
|
|
|
|
|
|
|
|
|
use yii\db\dao\TableSchema; |
|
|
|
use yii\db\TableSchema; |
|
|
|
use yii\db\dao\ColumnSchema; |
|
|
|
use yii\db\ColumnSchema; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Driver is the class for retrieving metadata from a MySQL database (version 4.1.x and 5.x). |
|
|
|
* Driver is the class for retrieving metadata from a MySQL database (version 4.1.x and 5.x). |
|
|
@ -18,7 +18,7 @@ use yii\db\dao\ColumnSchema; |
|
|
|
* @author Qiang Xue <qiang.xue@gmail.com> |
|
|
|
* @author Qiang Xue <qiang.xue@gmail.com> |
|
|
|
* @since 2.0 |
|
|
|
* @since 2.0 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
class Driver extends \yii\db\dao\Driver |
|
|
|
class Driver extends \yii\db\Driver |
|
|
|
{ |
|
|
|
{ |
|
|
|
/** |
|
|
|
/** |
|
|
|
* @var array mapping from physical column types (keys) to abstract column types (values) |
|
|
|
* @var array mapping from physical column types (keys) to abstract column types (values) |
|
|
@ -85,7 +85,7 @@ class Driver extends \yii\db\dao\Driver |
|
|
|
/** |
|
|
|
/** |
|
|
|
* Loads the metadata for the specified table. |
|
|
|
* Loads the metadata for the specified table. |
|
|
|
* @param string $name table name |
|
|
|
* @param string $name table name |
|
|
|
* @return \yii\db\dao\TableSchema driver dependent table metadata. Null if the table does not exist. |
|
|
|
* @return \yii\db\TableSchema driver dependent table metadata. Null if the table does not exist. |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
protected function loadTableSchema($name) |
|
|
|
protected function loadTableSchema($name) |
|
|
|
{ |
|
|
|
{ |
|
|
@ -100,7 +100,7 @@ class Driver extends \yii\db\dao\Driver |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Resolves the table name and schema name (if any). |
|
|
|
* Resolves the table name and schema name (if any). |
|
|
|
* @param \yii\db\dao\TableSchema $table the table metadata object |
|
|
|
* @param \yii\db\TableSchema $table the table metadata object |
|
|
|
* @param string $name the table name |
|
|
|
* @param string $name the table name |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
protected function resolveTableNames($table, $name) |
|
|
|
protected function resolveTableNames($table, $name) |
|
|
@ -142,7 +142,7 @@ class Driver extends \yii\db\dao\Driver |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Resolves the default value for the column. |
|
|
|
* Resolves the default value for the column. |
|
|
|
* @param \yii\db\dao\ColumnSchema $column the column metadata object |
|
|
|
* @param \yii\db\ColumnSchema $column the column metadata object |
|
|
|
* @param string $value the default value fetched from database |
|
|
|
* @param string $value the default value fetched from database |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
protected function resolveColumnDefault($column, $value) |
|
|
|
protected function resolveColumnDefault($column, $value) |
|
|
@ -154,7 +154,7 @@ class Driver extends \yii\db\dao\Driver |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Resolves the abstract data type for the column. |
|
|
|
* Resolves the abstract data type for the column. |
|
|
|
* @param \yii\db\dao\ColumnSchema $column the column metadata object |
|
|
|
* @param \yii\db\ColumnSchema $column the column metadata object |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public function resolveColumnType($column) |
|
|
|
public function resolveColumnType($column) |
|
|
|
{ |
|
|
|
{ |
|
|
@ -196,7 +196,7 @@ class Driver extends \yii\db\dao\Driver |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Collects the metadata of table columns. |
|
|
|
* Collects the metadata of table columns. |
|
|
|
* @param \yii\db\dao\TableSchema $table the table metadata |
|
|
|
* @param \yii\db\TableSchema $table the table metadata |
|
|
|
* @return boolean whether the table exists in the database |
|
|
|
* @return boolean whether the table exists in the database |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
protected function findColumns($table) |
|
|
|
protected function findColumns($table) |
|
|
@ -222,7 +222,7 @@ class Driver extends \yii\db\dao\Driver |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Collects the foreign key column details for the given table. |
|
|
|
* Collects the foreign key column details for the given table. |
|
|
|
* @param \yii\db\dao\TableSchema $table the table metadata |
|
|
|
* @param \yii\db\TableSchema $table the table metadata |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
protected function findConstraints($table) |
|
|
|
protected function findConstraints($table) |
|
|
|
{ |
|
|
|
{ |