<?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 Version20231110131340 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 tbl_societe (id INT AUTO_INCREMENT NOT NULL, ville INT DEFAULT NULL, logo_societe_id INT DEFAULT NULL, created_by INT DEFAULT NULL, updated_by INT DEFAULT NULL, deleted_by INT DEFAULT NULL, raison_social VARCHAR(255) DEFAULT NULL, adresse VARCHAR(255) DEFAULT NULL, code_postal VARCHAR(255) DEFAULT NULL, pays VARCHAR(255) DEFAULT NULL, departement VARCHAR(255) DEFAULT NULL, devise_principale VARCHAR(255) DEFAULT NULL, telephone VARCHAR(20) DEFAULT NULL, fax VARCHAR(20) DEFAULT NULL, email VARCHAR(255) DEFAULT NULL, web VARCHAR(255) DEFAULT NULL, note VARCHAR(255) DEFAULT NULL, created_at DATETIME DEFAULT NULL, updated_at DATETIME DEFAULT NULL, deleted_at DATETIME DEFAULT NULL, INDEX IDX_423635C943C3D9C3 (ville), UNIQUE INDEX UNIQ_423635C9D72CCFD7 (logo_societe_id), INDEX IDX_423635C9DE12AB56 (created_by), INDEX IDX_423635C916FE72E1 (updated_by), INDEX IDX_423635C91F6FA0AF (deleted_by), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE tbl_societe ADD CONSTRAINT FK_423635C943C3D9C3 FOREIGN KEY (ville) REFERENCES ref_ville (id)');
$this->addSql('ALTER TABLE tbl_societe ADD CONSTRAINT FK_423635C9D72CCFD7 FOREIGN KEY (logo_societe_id) REFERENCES tbl_file (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE tbl_societe ADD CONSTRAINT FK_423635C9DE12AB56 FOREIGN KEY (created_by) REFERENCES user (user_id)');
$this->addSql('ALTER TABLE tbl_societe ADD CONSTRAINT FK_423635C916FE72E1 FOREIGN KEY (updated_by) REFERENCES user (user_id)');
$this->addSql('ALTER TABLE tbl_societe ADD CONSTRAINT FK_423635C91F6FA0AF FOREIGN KEY (deleted_by) REFERENCES user (user_id)');
$this->addSql('ALTER TABLE tbl_file ADD file_ext VARCHAR(255) NOT NULL, ADD file_size VARCHAR(255) NOT NULL, ADD origin_name VARCHAR(255) NOT NULL');
$this->addSql('ALTER TABLE tbl_file DROP file_base64, CHANGE file_size file_size VARCHAR(255) DEFAULT NULL');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE tbl_societe DROP FOREIGN KEY FK_423635C943C3D9C3');
$this->addSql('ALTER TABLE tbl_societe DROP FOREIGN KEY FK_423635C9D72CCFD7');
$this->addSql('ALTER TABLE tbl_societe DROP FOREIGN KEY FK_423635C9DE12AB56');
$this->addSql('ALTER TABLE tbl_societe DROP FOREIGN KEY FK_423635C916FE72E1');
$this->addSql('ALTER TABLE tbl_societe DROP FOREIGN KEY FK_423635C91F6FA0AF');
$this->addSql('ALTER TABLE tbl_file DROP file_ext, DROP file_size, DROP origin_name');
$this->addSql('DROP TABLE tbl_societe');
}
}