<?php
declare(strict_types=1);
namespace CoreMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20220201121258 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 customers_bundle__customer (id BINARY(16) NOT NULL COMMENT \'(DC2Type:uuid)\', customer_type_id INT DEFAULT NULL, country_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', country_state_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', parent_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', created_by_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', updated_by_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', deleted_by_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', name VARCHAR(50) NOT NULL, address VARCHAR(255) DEFAULT NULL, address_2 VARCHAR(255) DEFAULT NULL, postcode VARCHAR(12) DEFAULT NULL, city VARCHAR(50) DEFAULT NULL, vat_number VARCHAR(32) DEFAULT NULL, phone VARCHAR(32) DEFAULT NULL, phone_mobile VARCHAR(32) DEFAULT NULL, email VARCHAR(255) DEFAULT NULL, website VARCHAR(128) DEFAULT NULL, internal_note LONGTEXT DEFAULT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, deleted_at DATETIME DEFAULT NULL, INDEX IDX_1FD6BD95D991282D (customer_type_id), INDEX IDX_1FD6BD95F92F3E70 (country_id), INDEX IDX_1FD6BD9536126D7C (country_state_id), INDEX IDX_1FD6BD95727ACA70 (parent_id), INDEX IDX_1FD6BD95B03A8386 (created_by_id), INDEX IDX_1FD6BD95896DBBDE (updated_by_id), INDEX IDX_1FD6BD95C76F1F52 (deleted_by_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE customers_bundle__customer_type (id INT AUTO_INCREMENT NOT NULL, created_by_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', updated_by_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', deleted_by_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', name VARCHAR(32) NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, deleted_at DATETIME DEFAULT NULL, INDEX IDX_635B5E09B03A8386 (created_by_id), INDEX IDX_635B5E09896DBBDE (updated_by_id), INDEX IDX_635B5E09C76F1F52 (deleted_by_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE customers_bundle__customer ADD CONSTRAINT FK_1FD6BD95D991282D FOREIGN KEY (customer_type_id) REFERENCES customers_bundle__customer_type (id)');
$this->addSql('ALTER TABLE customers_bundle__customer ADD CONSTRAINT FK_1FD6BD95F92F3E70 FOREIGN KEY (country_id) REFERENCES country (id)');
$this->addSql('ALTER TABLE customers_bundle__customer ADD CONSTRAINT FK_1FD6BD9536126D7C FOREIGN KEY (country_state_id) REFERENCES country_state (id)');
$this->addSql('ALTER TABLE customers_bundle__customer ADD CONSTRAINT FK_1FD6BD95727ACA70 FOREIGN KEY (parent_id) REFERENCES customers_bundle__customer (id)');
$this->addSql('ALTER TABLE customers_bundle__customer ADD CONSTRAINT FK_1FD6BD95B03A8386 FOREIGN KEY (created_by_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE customers_bundle__customer ADD CONSTRAINT FK_1FD6BD95896DBBDE FOREIGN KEY (updated_by_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE customers_bundle__customer ADD CONSTRAINT FK_1FD6BD95C76F1F52 FOREIGN KEY (deleted_by_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE customers_bundle__customer_type ADD CONSTRAINT FK_635B5E09B03A8386 FOREIGN KEY (created_by_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE customers_bundle__customer_type ADD CONSTRAINT FK_635B5E09896DBBDE FOREIGN KEY (updated_by_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE customers_bundle__customer_type ADD CONSTRAINT FK_635B5E09C76F1F52 FOREIGN KEY (deleted_by_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE currency CHANGE change_rate change_rate NUMERIC(20, 12) DEFAULT \'1\' NOT NULL');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE customers_bundle__customer DROP FOREIGN KEY FK_1FD6BD95727ACA70');
$this->addSql('ALTER TABLE customers_bundle__customer DROP FOREIGN KEY FK_1FD6BD95D991282D');
$this->addSql('DROP TABLE customers_bundle__customer');
$this->addSql('DROP TABLE customers_bundle__customer_type');
$this->addSql('ALTER TABLE categories_bundle__category CHANGE name name VARCHAR(255) NOT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE description description LONGTEXT DEFAULT NULL COLLATE `utf8mb4_unicode_ci`');
$this->addSql('ALTER TABLE categories_bundle__category_translations CHANGE locale locale VARCHAR(8) NOT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE field field VARCHAR(32) NOT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE content content LONGTEXT DEFAULT NULL COLLATE `utf8mb4_unicode_ci`');
$this->addSql('ALTER TABLE configuration CHANGE name name VARCHAR(255) NOT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE value value LONGTEXT DEFAULT NULL COLLATE `utf8mb4_unicode_ci`');
$this->addSql('ALTER TABLE context CHANGE name name VARCHAR(128) NOT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE address address VARCHAR(128) DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE address2 address2 VARCHAR(128) DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE postcode postcode VARCHAR(32) DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE city city VARCHAR(128) DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE phone phone VARCHAR(32) DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE email email VARCHAR(255) DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE website website VARCHAR(255) DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE vat_number vat_number VARCHAR(32) DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE siren siren VARCHAR(16) DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE siret siret VARCHAR(16) DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE ape ape VARCHAR(8) DEFAULT NULL COLLATE `utf8mb4_unicode_ci`');
$this->addSql('ALTER TABLE country CHANGE name name VARCHAR(128) NOT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE iso_code iso_code VARCHAR(6) DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE area_code area_code VARCHAR(6) DEFAULT NULL COLLATE `utf8mb4_unicode_ci`');
$this->addSql('ALTER TABLE country_state CHANGE name name VARCHAR(128) NOT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE iso_code iso_code VARCHAR(6) DEFAULT NULL COLLATE `utf8mb4_unicode_ci`');
$this->addSql('ALTER TABLE country_translations CHANGE locale locale VARCHAR(8) NOT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE field field VARCHAR(32) NOT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE content content LONGTEXT DEFAULT NULL COLLATE `utf8mb4_unicode_ci`');
$this->addSql('ALTER TABLE country_zone CHANGE name name VARCHAR(128) NOT NULL COLLATE `utf8mb4_unicode_ci`');
$this->addSql('ALTER TABLE country_zone_translations CHANGE locale locale VARCHAR(8) NOT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE field field VARCHAR(32) NOT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE content content LONGTEXT DEFAULT NULL COLLATE `utf8mb4_unicode_ci`');
$this->addSql('ALTER TABLE cron_job CHANGE name name VARCHAR(191) NOT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE command command VARCHAR(1024) NOT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE schedule schedule VARCHAR(191) NOT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE description description VARCHAR(191) NOT NULL COLLATE `utf8mb4_unicode_ci`');
$this->addSql('ALTER TABLE cron_report CHANGE output output LONGTEXT NOT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE error error LONGTEXT NOT NULL COLLATE `utf8mb4_unicode_ci`');
$this->addSql('ALTER TABLE currency CHANGE name name VARCHAR(64) NOT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE iso_code iso_code VARCHAR(6) NOT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE change_rate change_rate NUMERIC(20, 12) DEFAULT \'1.000000000000\' NOT NULL');
$this->addSql('ALTER TABLE ext_translations CHANGE locale locale VARCHAR(8) NOT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE object_class object_class VARCHAR(191) NOT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE field field VARCHAR(32) NOT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE foreign_key foreign_key VARCHAR(64) NOT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE content content LONGTEXT DEFAULT NULL COLLATE `utf8mb4_unicode_ci`');
$this->addSql('ALTER TABLE file_manager CHANGE key_path key_path VARCHAR(255) NOT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE original_filename original_filename LONGTEXT DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE mime_type mime_type VARCHAR(128) NOT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE extension extension VARCHAR(10) DEFAULT NULL COLLATE `utf8mb4_unicode_ci`');
$this->addSql('ALTER TABLE language CHANGE name name VARCHAR(128) NOT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE iso_code iso_code VARCHAR(3) NOT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE locale locale VARCHAR(6) NOT NULL COLLATE `utf8mb4_unicode_ci`');
$this->addSql('ALTER TABLE messenger_messages CHANGE body body LONGTEXT NOT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE headers headers LONGTEXT NOT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE queue_name queue_name VARCHAR(255) NOT NULL COLLATE `utf8mb4_unicode_ci`');
$this->addSql('ALTER TABLE notification CHANGE object object LONGTEXT NOT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE render render LONGTEXT NOT NULL COLLATE `utf8mb4_unicode_ci`');
$this->addSql('ALTER TABLE products_bundle__attribute CHANGE name name VARCHAR(128) NOT NULL COLLATE `utf8mb4_unicode_ci`');
$this->addSql('ALTER TABLE products_bundle__attribute_group CHANGE name name VARCHAR(128) NOT NULL COLLATE `utf8mb4_unicode_ci`');
$this->addSql('ALTER TABLE products_bundle__attribute_group_translations CHANGE locale locale VARCHAR(8) NOT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE field field VARCHAR(32) NOT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE content content LONGTEXT DEFAULT NULL COLLATE `utf8mb4_unicode_ci`');
$this->addSql('ALTER TABLE products_bundle__attribute_translations CHANGE locale locale VARCHAR(8) NOT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE field field VARCHAR(32) NOT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE content content LONGTEXT DEFAULT NULL COLLATE `utf8mb4_unicode_ci`');
$this->addSql('ALTER TABLE products_bundle__brand CHANGE name name VARCHAR(255) NOT NULL COLLATE `utf8mb4_unicode_ci`');
$this->addSql('ALTER TABLE products_bundle__brand_translations CHANGE locale locale VARCHAR(8) NOT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE field field VARCHAR(32) NOT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE content content LONGTEXT DEFAULT NULL COLLATE `utf8mb4_unicode_ci`');
$this->addSql('ALTER TABLE products_bundle__declination CHANGE reference reference VARCHAR(128) DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE ean13 ean13 VARCHAR(13) DEFAULT NULL COLLATE `utf8mb4_unicode_ci`');
$this->addSql('ALTER TABLE products_bundle__eco_part CHANGE name name VARCHAR(128) NOT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE reference reference VARCHAR(128) DEFAULT NULL COLLATE `utf8mb4_unicode_ci`');
$this->addSql('ALTER TABLE products_bundle__eco_part_group CHANGE name name VARCHAR(128) NOT NULL COLLATE `utf8mb4_unicode_ci`');
$this->addSql('ALTER TABLE products_bundle__eco_part_group_translations CHANGE locale locale VARCHAR(8) NOT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE field field VARCHAR(32) NOT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE content content LONGTEXT DEFAULT NULL COLLATE `utf8mb4_unicode_ci`');
$this->addSql('ALTER TABLE products_bundle__eco_part_translations CHANGE locale locale VARCHAR(8) NOT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE field field VARCHAR(32) NOT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE content content LONGTEXT DEFAULT NULL COLLATE `utf8mb4_unicode_ci`');
$this->addSql('ALTER TABLE products_bundle__product CHANGE name name VARCHAR(255) NOT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE reference reference VARCHAR(255) DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE summary summary VARCHAR(255) DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE ean13 ean13 VARCHAR(13) DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE description description LONGTEXT DEFAULT NULL COLLATE `utf8mb4_unicode_ci`');
$this->addSql('ALTER TABLE products_bundle__product_translations CHANGE locale locale VARCHAR(8) NOT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE field field VARCHAR(32) NOT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE content content LONGTEXT DEFAULT NULL COLLATE `utf8mb4_unicode_ci`');
$this->addSql('ALTER TABLE products_bundle__product_type CHANGE name name VARCHAR(40) NOT NULL COLLATE `utf8mb4_unicode_ci`');
$this->addSql('ALTER TABLE products_bundle__product_type_translations CHANGE locale locale VARCHAR(8) NOT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE field field VARCHAR(32) NOT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE content content LONGTEXT DEFAULT NULL COLLATE `utf8mb4_unicode_ci`');
$this->addSql('ALTER TABLE profile CHANGE name name VARCHAR(64) NOT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE roles roles LONGTEXT NOT NULL COLLATE `utf8mb4_unicode_ci` COMMENT \'(DC2Type:json)\'');
$this->addSql('ALTER TABLE tax CHANGE name name VARCHAR(64) NOT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE account_number account_number VARCHAR(32) DEFAULT NULL COLLATE `utf8mb4_unicode_ci`');
$this->addSql('ALTER TABLE tax_rule CHANGE name name VARCHAR(128) NOT NULL COLLATE `utf8mb4_unicode_ci`');
$this->addSql('ALTER TABLE unit_measure CHANGE name name VARCHAR(40) NOT NULL COLLATE `utf8mb4_unicode_ci`');
$this->addSql('ALTER TABLE user CHANGE firstname firstname VARCHAR(32) NOT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE lastname lastname VARCHAR(32) NOT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE email email VARCHAR(128) NOT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE password password VARCHAR(255) DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE token token VARCHAR(40) DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE config config LONGTEXT DEFAULT NULL COLLATE `utf8mb4_unicode_ci` COMMENT \'(DC2Type:json)\'');
$this->addSql('ALTER TABLE user_login_log CHANGE ipv4 ipv4 VARCHAR(19) DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE ipv6 ipv6 VARCHAR(255) DEFAULT NULL COLLATE `utf8mb4_unicode_ci`');
}
}