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