<?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 Version20220127193617 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('ALTER TABLE client CHANGE address address VARCHAR(100) DEFAULT NULL, CHANGE phone phone VARCHAR(50) DEFAULT NULL, CHANGE city city VARCHAR(50) DEFAULT NULL, CHANGE mail mail VARCHAR(100) DEFAULT NULL, CHANGE vat_number vat_number VARCHAR(100) DEFAULT NULL');
$this->addSql('ALTER TABLE product ADD sold_to_id VARCHAR(255) DEFAULT NULL, ADD short_description_alt VARCHAR(255) DEFAULT NULL, ADD description_alt VARCHAR(255) DEFAULT NULL, ADD name_alt VARCHAR(255) DEFAULT NULL, ADD url_video VARCHAR(255) DEFAULT NULL, DROP client, CHANGE description description VARCHAR(255) DEFAULT NULL, CHANGE invoice_number invoice_number VARCHAR(255) DEFAULT NULL');
$this->addSql('ALTER TABLE product ADD CONSTRAINT FK_D34A04AD8E5CC2C0 FOREIGN KEY (sold_to_id) REFERENCES client (id)');
$this->addSql('CREATE INDEX IDX_D34A04AD8E5CC2C0 ON product (sold_to_id)');
$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 client CHANGE address address VARCHAR(100) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE phone phone VARCHAR(50) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE city city VARCHAR(50) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE mail mail VARCHAR(100) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE vat_number vat_number VARCHAR(100) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`');
$this->addSql('ALTER TABLE product DROP FOREIGN KEY FK_D34A04AD8E5CC2C0');
$this->addSql('DROP INDEX IDX_D34A04AD8E5CC2C0 ON product');
$this->addSql('ALTER TABLE product ADD client VARCHAR(255) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, DROP sold_to_id, DROP short_description_alt, DROP description_alt, DROP name_alt, DROP url_video, CHANGE description description VARCHAR(255) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE invoice_number invoice_number VARCHAR(255) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`');
$this->addSql('ALTER TABLE user CHANGE roles roles LONGTEXT CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_bin`');
}
}