mirror of
https://github.com/espocrm/espocrm.git
synced 2026-06-28 23:16:03 +00:00
fix autoincrement field
This commit is contained in:
@@ -18,6 +18,7 @@ class Schema
|
||||
'default' => 'default',
|
||||
'notnull' => 'notnull',
|
||||
'autoincrement' => 'autoincrement',
|
||||
'unique' => 'unique',
|
||||
);
|
||||
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
},
|
||||
"database":{
|
||||
"type":"int",
|
||||
"autoincrement":true
|
||||
"autoincrement":true,
|
||||
"unique":true
|
||||
}
|
||||
}
|
||||
|
||||
@@ -541,6 +541,7 @@ class MySqlPlatform extends AbstractPlatform
|
||||
$column = $columnDiff->column;
|
||||
$columnArray = $column->toArray();
|
||||
$columnArray['comment'] = $this->getColumnComment($column);
|
||||
|
||||
$queryParts[] = 'CHANGE ' . ($columnDiff->oldColumnName) . ' '
|
||||
. $this->getColumnDeclarationSQL($column->getQuotedName($this), $columnArray);
|
||||
}
|
||||
|
||||
@@ -76,6 +76,11 @@ class Column extends AbstractAsset
|
||||
*/
|
||||
protected $_autoincrement = false;
|
||||
|
||||
/**
|
||||
* @var boolean
|
||||
*/
|
||||
protected $_unique = false; //espo
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
@@ -222,6 +227,18 @@ class Column extends AbstractAsset
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param boolean $unique
|
||||
*
|
||||
* @return \Doctrine\DBAL\Schema\Column
|
||||
*/
|
||||
public function setUnique($unique) //espo
|
||||
{
|
||||
$this->_unique = (bool)$unique;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mixed $default
|
||||
*
|
||||
@@ -487,6 +504,7 @@ class Column extends AbstractAsset
|
||||
'fixed' => $this->_fixed,
|
||||
'unsigned' => $this->_unsigned,
|
||||
'autoincrement' => $this->_autoincrement,
|
||||
'unique' => $this->_unique, //espo
|
||||
'columnDefinition' => $this->_columnDefinition,
|
||||
'comment' => $this->_comment,
|
||||
), $this->_platformOptions, $this->_customSchemaOptions);
|
||||
|
||||
Reference in New Issue
Block a user