| @@ 491-504 (lines=14) @@ | ||
| 488 | * |
|
| 489 | * @return $this |
|
| 490 | */ |
|
| 491 | public function addForeignKeyWithName($name, $columns, $referencedTable, $referencedColumns = ['id'], $options = []) |
|
| 492 | { |
|
| 493 | $action = AddForeignKey::build( |
|
| 494 | $this->table, |
|
| 495 | $columns, |
|
| 496 | $referencedTable, |
|
| 497 | $referencedColumns, |
|
| 498 | $options, |
|
| 499 | $name |
|
| 500 | ); |
|
| 501 | $this->actions->addAction($action); |
|
| 502 | ||
| 503 | return $this; |
|
| 504 | } |
|
| 505 | ||
| 506 | /** |
|
| 507 | * Removes the given foreign key from the table. |
|
| @@ 469-475 (lines=7) @@ | ||
| 466 | * |
|
| 467 | * @return $this |
|
| 468 | */ |
|
| 469 | public function addForeignKey($columns, $referencedTable, $referencedColumns = ['id'], $options = []) |
|
| 470 | { |
|
| 471 | $action = AddForeignKey::build($this->table, $columns, $referencedTable, $referencedColumns, $options); |
|
| 472 | $this->actions->addAction($action); |
|
| 473 | ||
| 474 | return $this; |
|
| 475 | } |
|
| 476 | ||
| 477 | /** |
|
| 478 | * Add a foreign key to a database table with a given name. |
|