mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-03 22:32:40 +08:00
Fixed sequence id match for postgresql
PgAdmin generates sequence as '"Schema"."Table_seq"'::regclass when non public schema is used.
This commit is contained in:
@ -299,7 +299,7 @@ SQL;
|
||||
$table->columns[$column->name] = $column;
|
||||
if ($column->isPrimaryKey === true) {
|
||||
$table->primaryKey[] = $column->name;
|
||||
if ($table->sequenceName === null && preg_match("/nextval\\('\"?\\w+\"?'(::regclass)?\\)/", $column->defaultValue) === 1) {
|
||||
if ($table->sequenceName === null && preg_match("/nextval\\('\"?\\w+\"?\.?\"?\\w+\"?'(::regclass)?\\)/", $column->defaultValue) === 1) {
|
||||
$table->sequenceName = preg_replace(['/nextval/', '/::/', '/regclass/', '/\'\)/', '/\(\'/'], '', $column->defaultValue);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user