20221109225114_add_ticket_comment_attachment_table.php 617 B

12345678910111213141516
  1. <?php
  2. declare(strict_types=1);
  3. use Phinx\Migration\AbstractMigration;
  4. final class AddTicketCommentAttachmentTable extends AbstractMigration {
  5. public function change(): void {
  6. $this->table("ticket_comment_attachment", ["signed" => false, "collation" => "utf8mb4_general_ci"])
  7. ->addColumn("ticket_comment_id", "integer", ["signed" => false])
  8. ->addColumn("mime_type", "string")
  9. ->addColumn("file_name", "string")
  10. ->addColumn("file_size", "integer", ["signed" => false])
  11. ->addForeignKey("ticket_comment_id", "ticket_comment", "id", ["update" => "CASCADE", "delete" => "RESTRICT"])
  12. ->create();
  13. }
  14. }