|
@@ 123-134 (lines=12) @@
|
| 120 |
|
$node->name === 'addUniqueIndex' || |
| 121 |
|
$node->name === 'renameIndex' || |
| 122 |
|
$node->name === 'setPrimaryKey') { |
| 123 |
|
if (isset($node->args[1]) && $node->args[1]->value instanceof Node\Scalar\String_) { |
| 124 |
|
if (!$this->checkNameLength($node->args[1]->value->value)) { |
| 125 |
|
$this->errors[] = [ |
| 126 |
|
'line' => $node->getLine(), |
| 127 |
|
'disallowedToken' => $node->args[1]->value->value, |
| 128 |
|
'reason' => sprintf( |
| 129 |
|
'Index name is too long on table `%s` (max. 27)', |
| 130 |
|
$this->tableVariableNames[$node->var->name] |
| 131 |
|
), |
| 132 |
|
]; |
| 133 |
|
} |
| 134 |
|
} |
| 135 |
|
} else if ($node->name === 'addForeignKeyConstraint') { |
| 136 |
|
if (isset($node->args[4]) && $node->args[4]->value instanceof Node\Scalar\String_) { |
| 137 |
|
if (!$this->checkNameLength($node->args[4]->value->value)) { |
|
@@ 136-147 (lines=12) @@
|
| 133 |
|
} |
| 134 |
|
} |
| 135 |
|
} else if ($node->name === 'addForeignKeyConstraint') { |
| 136 |
|
if (isset($node->args[4]) && $node->args[4]->value instanceof Node\Scalar\String_) { |
| 137 |
|
if (!$this->checkNameLength($node->args[4]->value->value)) { |
| 138 |
|
$this->errors[] = [ |
| 139 |
|
'line' => $node->getLine(), |
| 140 |
|
'disallowedToken' => $node->args[4]->value->value, |
| 141 |
|
'reason' => sprintf( |
| 142 |
|
'Constraint name is too long on table `%s` (max. 27)', |
| 143 |
|
$this->tableVariableNames[$node->var->name] |
| 144 |
|
), |
| 145 |
|
]; |
| 146 |
|
} |
| 147 |
|
} |
| 148 |
|
} else if ($node->name === 'renameColumn') { |
| 149 |
|
$this->errors[] = [ |
| 150 |
|
'line' => $node->getLine(), |