20221221235212_add_company_id_field_to_document_table.php 419 B

12345678910111213
  1. <?php
  2. declare(strict_types=1);
  3. use Phinx\Migration\AbstractMigration;
  4. final class AddCompanyIdFieldToDocumentTable extends AbstractMigration {
  5. public function change(): void {
  6. $this->table("document")
  7. ->addColumn("company_id", "integer", ["signed" => false, "after" => "id", "null" => true])
  8. ->addForeignKey("company_id", "company", "id", ["update" => "CASCADE", "delete" => "RESTRICT"])
  9. ->update();
  10. }
  11. }