<?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 Version20220919091838 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE TABLE toast (id INT AUTO_INCREMENT NOT NULL, uid_id INT DEFAULT NULL, content LONGTEXT DEFAULT NULL, start_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', end_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', UNIQUE INDEX UNIQ_B35A6840534B549B (uid_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE toast ADD CONSTRAINT FK_B35A6840534B549B FOREIGN KEY (uid_id) REFERENCES uid (id)');
$this->addSql('ALTER TABLE lot DROP FOREIGN KEY FK_B81291BF5B7AF75');
$this->addSql('DROP INDEX UNIQ_B81291BF5B7AF75 ON lot');
$this->addSql('ALTER TABLE lot DROP address_id');
$this->addSql('ALTER TABLE operation ADD address_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE operation ADD CONSTRAINT FK_1981A66DF5B7AF75 FOREIGN KEY (address_id) REFERENCES address (id)');
$this->addSql('CREATE UNIQUE INDEX UNIQ_1981A66DF5B7AF75 ON operation (address_id)');
$this->addSql('ALTER TABLE profil_mo ADD function VARCHAR(255) DEFAULT NULL');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('DROP TABLE toast');
$this->addSql('ALTER TABLE lot ADD address_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE lot ADD CONSTRAINT FK_B81291BF5B7AF75 FOREIGN KEY (address_id) REFERENCES address (id)');
$this->addSql('CREATE UNIQUE INDEX UNIQ_B81291BF5B7AF75 ON lot (address_id)');
$this->addSql('ALTER TABLE operation DROP FOREIGN KEY FK_1981A66DF5B7AF75');
$this->addSql('DROP INDEX UNIQ_1981A66DF5B7AF75 ON operation');
$this->addSql('ALTER TABLE operation DROP address_id');
$this->addSql('ALTER TABLE profil_mo DROP function');
}
}