migrations/Version20250605092300.php line 1

  1. <?php
  2. declare(strict_types=1);
  3. namespace DoctrineMigrations;
  4. use Doctrine\DBAL\Schema\Schema;
  5. use Doctrine\Migrations\AbstractMigration;
  6. /**
  7.  * Auto-generated Migration: Please modify to your needs!
  8.  */
  9. final class Version20250605092300 extends AbstractMigration
  10. {
  11.     public function getDescription(): string
  12.     {
  13.         return '';
  14.     }
  15.     public function up(Schema $schema): void
  16.     {
  17.         // this up() migration is auto-generated, please modify it to your needs
  18.         $this->addSql(<<<'SQL'
  19.             CREATE TABLE pre_consultation_message (
  20.                 id INT AUTO_INCREMENT NOT NULL,
  21.                 client_id INT UNSIGNED DEFAULT NULL,
  22.                 user_pseudo_id INT DEFAULT NULL,
  23.                 photos LONGTEXT DEFAULT NULL COMMENT '(DC2Type:json)',
  24.                 subject VARCHAR(255) NOT NULL,
  25.                 message LONGTEXT NOT NULL,
  26.                 created_at DATETIME NOT NULL,
  27.                 INDEX IDX_E9483D3819EB6921 (client_id),
  28.                 INDEX IDX_E9483D3820031926 (user_pseudo_id),
  29.                 PRIMARY KEY(id)
  30.             ) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB
  31.         SQL);
  32.         $this->addSql(<<<'SQL'
  33.             ALTER TABLE pre_consultation_message ADD CONSTRAINT FK_E9483D3819EB6921 FOREIGN KEY (client_id) REFERENCES client (id_client)
  34.         SQL);
  35.         $this->addSql(<<<'SQL'
  36.             ALTER TABLE pre_consultation_message ADD CONSTRAINT FK_E9483D3820031926 FOREIGN KEY (user_pseudo_id) REFERENCES user_pseudo (user_pseudo_id)
  37.         SQL);
  38.     }
  39.     public function down(Schema $schema): void
  40.     {
  41.         // this down() migration is auto-generated, please modify it to your needs
  42.         $this->addSql('DROP TABLE pre_consultation_message');
  43.     }
  44. }