Commit 6a4ed5a1 by Carsten Brandt

fixed cubrid schema primary key detection

parent 4e32b775
...@@ -138,11 +138,15 @@ class Schema extends \yii\db\Schema ...@@ -138,11 +138,15 @@ class Schema extends \yii\db\Schema
foreach ($columns as $info) { foreach ($columns as $info) {
$column = $this->loadColumnSchema($info); $column = $this->loadColumnSchema($info);
$table->columns[$column->name] = $column; $table->columns[$column->name] = $column;
if ($column->isPrimaryKey) { }
$table->primaryKey[] = $column->name;
if ($column->autoIncrement) { $primaryKeys = $this->db->pdo->cubrid_schema(\PDO::CUBRID_SCH_PRIMARY_KEY, $table->name);
$table->sequenceName = ''; foreach ($primaryKeys as $key) {
} $column = $table->columns[$key['ATTR_NAME']];
$column->isPrimaryKey = true;
$table->primaryKey[] = $column->name;
if ($column->autoIncrement) {
$table->sequenceName = '';
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment