<?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 Version20220721113718 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 pglobal_param (id INT AUTO_INCREMENT NOT NULL, active TINYINT(1) NOT NULL, designation VARCHAR(255) DEFAULT NULL, abreviation VARCHAR(255) DEFAULT NULL, code VARCHAR(255) DEFAULT NULL, prefix VARCHAR(30) DEFAULT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE pglobal_param_det (id INT AUTO_INCREMENT NOT NULL, cab_id INT DEFAULT NULL, k VARCHAR(255) DEFAULT NULL, v VARCHAR(255) DEFAULT NULL, active TINYINT(1) NOT NULL, INDEX IDX_DDA5909293DFA100 (cab_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE uppartenaire (id INT AUTO_INCREMENT NOT NULL, categorie_id INT DEFAULT NULL, type_partenaire_id INT DEFAULT NULL, statut_id INT DEFAULT NULL, code VARCHAR(255) DEFAULT NULL, nom VARCHAR(255) DEFAULT NULL, prenom VARCHAR(255) DEFAULT NULL, societe VARCHAR(255) DEFAULT NULL, adresse VARCHAR(255) DEFAULT NULL, pays VARCHAR(255) DEFAULT NULL, ville VARCHAR(255) DEFAULT NULL, tel1 VARCHAR(20) DEFAULT NULL, tel2 VARCHAR(20) DEFAULT NULL, tel3 VARCHAR(20) DEFAULT NULL, fax1 VARCHAR(255) DEFAULT NULL, fax2 VARCHAR(20) DEFAULT NULL, mail1 VARCHAR(255) DEFAULT NULL, mail2 VARCHAR(255) DEFAULT NULL, rib VARCHAR(255) DEFAULT NULL, banque VARCHAR(255) DEFAULT NULL, active TINYINT(1) NOT NULL, taxable VARCHAR(255) DEFAULT NULL, tva VARCHAR(255) DEFAULT NULL, iff VARCHAR(255) DEFAULT NULL, rc VARCHAR(255) DEFAULT NULL, ice VARCHAR(255) DEFAULT NULL, patente VARCHAR(255) DEFAULT NULL, created DATETIME DEFAULT NULL, lettrage_adonix VARCHAR(255) DEFAULT NULL, INDEX IDX_E86BA97DBCF5E72D (categorie_id), INDEX IDX_E86BA97DE833A499 (type_partenaire_id), INDEX IDX_E86BA97DF6203804 (statut_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE pglobal_param_det ADD CONSTRAINT FK_DDA5909293DFA100 FOREIGN KEY (cab_id) REFERENCES pglobal_param (id)');
$this->addSql('ALTER TABLE uppartenaire ADD CONSTRAINT FK_E86BA97DBCF5E72D FOREIGN KEY (categorie_id) REFERENCES pglobal_param_det (id)');
$this->addSql('ALTER TABLE uppartenaire ADD CONSTRAINT FK_E86BA97DE833A499 FOREIGN KEY (type_partenaire_id) REFERENCES pglobal_param_det (id)');
$this->addSql('ALTER TABLE uppartenaire ADD CONSTRAINT FK_E86BA97DF6203804 FOREIGN KEY (statut_id) REFERENCES pstatut (id)');
$this->addSql('ALTER TABLE uarticle CHANGE created created DATETIME DEFAULT NULL');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE pglobal_param_det DROP FOREIGN KEY FK_DDA5909293DFA100');
$this->addSql('ALTER TABLE uppartenaire DROP FOREIGN KEY FK_E86BA97DBCF5E72D');
$this->addSql('ALTER TABLE uppartenaire DROP FOREIGN KEY FK_E86BA97DE833A499');
$this->addSql('DROP TABLE pglobal_param');
$this->addSql('DROP TABLE pglobal_param_det');
$this->addSql('DROP TABLE uppartenaire');
$this->addSql('ALTER TABLE uarticle CHANGE created created DATETIME DEFAULT CURRENT_TIMESTAMP');
}
}