migrations/Version20240819065320.php line 1

Open in your IDE?
  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 Version20240819065320 extends AbstractMigration
  10. {
  11.     public function getDescription(): string
  12.     {
  13.         return '';
  14.     }
  15.     public function up(Schema $schema): void
  16.     {
  17.         $this->addSql('ALTER TABLE user ADD societe_livraison_id INT DEFAULT NULL, CHANGE roles roles JSON NOT NULL');
  18.         $this->addSql('ALTER TABLE user ADD CONSTRAINT FK_8D93D649448E9678 FOREIGN KEY (societe_livraison_id) REFERENCES societe_livraison (id)');
  19.         $this->addSql('CREATE INDEX IDX_8D93D649448E9678 ON user (societe_livraison_id)');
  20.     }
  21.     public function down(Schema $schema): void
  22.     {
  23.         $this->addSql('ALTER TABLE user DROP FOREIGN KEY FK_8D93D649448E9678');
  24.         $this->addSql('DROP INDEX IDX_8D93D649448E9678 ON user');
  25.         $this->addSql('ALTER TABLE user DROP societe_livraison_id, CHANGE roles roles JSON NOT NULL COLLATE `utf8mb4_bin`');
  26.     }
  27. }