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