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