<?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 Version20240318130352 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 campaign_pending_to_send (id INT AUTO_INCREMENT NOT NULL, campaign_id VARCHAR(22) DEFAULT NULL, user_id VARCHAR(22) DEFAULT NULL, company_id VARCHAR(22) DEFAULT NULL, created_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', is_send TINYINT(1) NOT NULL, INDEX IDX_F6455386F639F774 (campaign_id), INDEX IDX_F6455386A76ED395 (user_id), INDEX IDX_F6455386979B1AD6 (company_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE confidentiality_contract (id INT AUTO_INCREMENT NOT NULL, user_id VARCHAR(22) DEFAULT NULL, company_id VARCHAR(22) DEFAULT NULL, link_subcontractor LONGTEXT NOT NULL, link_my_flow LONGTEXT NOT NULL, created_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', INDEX IDX_40BB8551A76ED395 (user_id), INDEX IDX_40BB8551979B1AD6 (company_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE campaign_pending_to_send ADD CONSTRAINT FK_F6455386F639F774 FOREIGN KEY (campaign_id) REFERENCES campaigns (id)');
$this->addSql('ALTER TABLE campaign_pending_to_send ADD CONSTRAINT FK_F6455386A76ED395 FOREIGN KEY (user_id) REFERENCES users (id)');
$this->addSql('ALTER TABLE campaign_pending_to_send ADD CONSTRAINT FK_F6455386979B1AD6 FOREIGN KEY (company_id) REFERENCES companies (id)');
$this->addSql('ALTER TABLE confidentiality_contract ADD CONSTRAINT FK_40BB8551A76ED395 FOREIGN KEY (user_id) REFERENCES users (id)');
$this->addSql('ALTER TABLE confidentiality_contract ADD CONSTRAINT FK_40BB8551979B1AD6 FOREIGN KEY (company_id) REFERENCES companies (id)');
$this->addSql('ALTER TABLE campaigns ADD type_initiation INT DEFAULT NULL, CHANGE is_ordored_by_admin is_ordored_by_admin TINYINT(1) NOT NULL');
$this->addSql('ALTER TABLE companies DROP INDEX FK_8244AA3A17A7BBEB, ADD UNIQUE INDEX UNIQ_8244AA3A17A7BBEB (company_data_id)');
$this->addSql('ALTER TABLE company_data ADD preferred_language VARCHAR(255) DEFAULT NULL, ADD legal_status VARCHAR(255) DEFAULT NULL, ADD share_capital DOUBLE PRECISION DEFAULT NULL');
$this->addSql('ALTER TABLE credit_history CHANGE credit credit DOUBLE PRECISION DEFAULT NULL, CHANGE mensualite mensualite DOUBLE PRECISION DEFAULT NULL, CHANGE annuite annuite DOUBLE PRECISION DEFAULT NULL');
$this->addSql('ALTER TABLE users CHANGE device_connected_list device_connected_list LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:array)\'');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('DROP TABLE campaign_pending_to_send');
$this->addSql('DROP TABLE confidentiality_contract');
$this->addSql('ALTER TABLE campaigns DROP type_initiation, CHANGE is_ordored_by_admin is_ordored_by_admin TINYTEXT CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`');
$this->addSql('ALTER TABLE companies DROP INDEX UNIQ_8244AA3A17A7BBEB, ADD INDEX FK_8244AA3A17A7BBEB (company_data_id)');
$this->addSql('ALTER TABLE company_data DROP preferred_language, DROP legal_status, DROP share_capital');
$this->addSql('ALTER TABLE credit_history CHANGE credit credit INT DEFAULT NULL, CHANGE mensualite mensualite INT DEFAULT NULL, CHANGE annuite annuite INT DEFAULT NULL');
$this->addSql('ALTER TABLE users CHANGE device_connected_list device_connected_list LONGTEXT CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci` COMMENT \' (DC2Type:array)\'');
}
}