<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20240819065320 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
$this->addSql('ALTER TABLE user ADD societe_livraison_id INT DEFAULT NULL, CHANGE roles roles JSON NOT NULL');
$this->addSql('ALTER TABLE user ADD CONSTRAINT FK_8D93D649448E9678 FOREIGN KEY (societe_livraison_id) REFERENCES societe_livraison (id)');
$this->addSql('CREATE INDEX IDX_8D93D649448E9678 ON user (societe_livraison_id)');
}
public function down(Schema $schema): void
{
$this->addSql('ALTER TABLE user DROP FOREIGN KEY FK_8D93D649448E9678');
$this->addSql('DROP INDEX IDX_8D93D649448E9678 ON user');
$this->addSql('ALTER TABLE user DROP societe_livraison_id, CHANGE roles roles JSON NOT NULL COLLATE `utf8mb4_bin`');
}
}