<?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 Version20251111110209 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 as_demenagement_address (id INT AUTO_INCREMENT NOT NULL, street VARCHAR(255) DEFAULT NULL, street_2 VARCHAR(255) DEFAULT NULL, postal_code VARCHAR(255) DEFAULT NULL, city VARCHAR(255) DEFAULT NULL, country VARCHAR(255) DEFAULT NULL, floor INT DEFAULT NULL, elevator INT DEFAULT NULL, notes VARCHAR(255) DEFAULT NULL, category VARCHAR(255) DEFAULT NULL, step VARCHAR(10) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE as_demenagement_quotation ADD loading_address_id INT DEFAULT NULL, ADD unloading_address_id INT DEFAULT NULL, CHANGE requirements_unloading requirements_unloading LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:json)\', CHANGE tva_rate tva_rate DOUBLE PRECISION DEFAULT NULL');
$this->addSql('ALTER TABLE as_demenagement_quotation ADD CONSTRAINT FK_732753010AEBBB FOREIGN KEY (loading_address_id) REFERENCES address (id)');
$this->addSql('ALTER TABLE as_demenagement_quotation ADD CONSTRAINT FK_7327530727DB8F6 FOREIGN KEY (unloading_address_id) REFERENCES address (id)');
$this->addSql('CREATE INDEX IDX_732753010AEBBB ON as_demenagement_quotation (loading_address_id)');
$this->addSql('CREATE INDEX IDX_7327530727DB8F6 ON as_demenagement_quotation (unloading_address_id)');
$this->addSql('ALTER TABLE as_demenagement_quotation_option CHANGE mode mode VARCHAR(20) NOT NULL');
//$this->addSql('ALTER TABLE exemple_page_content CHANGE content content LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:json)\'');
//$this->addSql('ALTER TABLE user CHANGE roles roles LONGTEXT NOT NULL COMMENT \'(DC2Type:json)\'');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE as_demenagement_quotation DROP FOREIGN KEY FK_732753010AEBBB');
$this->addSql('ALTER TABLE as_demenagement_quotation DROP FOREIGN KEY FK_7327530727DB8F6');
$this->addSql('DROP TABLE as_demenagement_address');
$this->addSql('DROP INDEX IDX_732753010AEBBB ON as_demenagement_quotation');
$this->addSql('DROP INDEX IDX_7327530727DB8F6 ON as_demenagement_quotation');
$this->addSql('ALTER TABLE as_demenagement_quotation DROP loading_address_id, DROP unloading_address_id, CHANGE requirements_unloading requirements_unloading LONGTEXT DEFAULT NULL COLLATE `utf8mb4_bin`, CHANGE tva_rate tva_rate DOUBLE PRECISION DEFAULT \'20\'');
$this->addSql('ALTER TABLE as_demenagement_quotation_option CHANGE mode mode VARCHAR(20) DEFAULT \'none\' NOT NULL');
//$this->addSql('ALTER TABLE exemple_page_content CHANGE content content LONGTEXT DEFAULT NULL COLLATE `utf8mb4_bin`');
//$this->addSql('ALTER TABLE user CHANGE roles roles LONGTEXT NOT NULL COLLATE `utf8mb4_bin`');
}
}