| @@ 319-325 (lines=7) @@ | ||
| 316 | $line .= " " . Token::escapeIdentifier($this->name); |
|
| 317 | } |
|
| 318 | $cols = []; |
|
| 319 | foreach ($this->columns as $column) { |
|
| 320 | $col = Token::escapeIdentifier($column['name']); |
|
| 321 | if (!is_null($column['length'])) { |
|
| 322 | $col .= "(" . $column['length'] . ")"; |
|
| 323 | } |
|
| 324 | $cols[] = $col; |
|
| 325 | } |
|
| 326 | $line .= " (" . implode(',', $cols) . ")"; |
|
| 327 | ||
| 328 | if (isset($this->options['USING'])) { |
|
| @@ 348-354 (lines=7) @@ | ||
| 345 | } |
|
| 346 | $line .= " REFERENCES $reference"; |
|
| 347 | $cols = []; |
|
| 348 | foreach ($this->reference['columns'] as $column) { |
|
| 349 | $col = Token::escapeIdentifier($column['name']); |
|
| 350 | if (!is_null($column['length'])) { |
|
| 351 | $col .= "(" . $column['length'] . ")"; |
|
| 352 | } |
|
| 353 | $cols[] = $col; |
|
| 354 | } |
|
| 355 | $line .= " (" . implode(',', $cols) . ")"; |
|
| 356 | foreach (['ON DELETE', 'ON UPDATE'] as $clause) { |
|
| 357 | $action = $this->reference[$clause]; |
|