<?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 Version20230710101506 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 ref_moyen_transport (id INT AUTO_INCREMENT NOT NULL, libelle VARCHAR(255) DEFAULT NULL, matricule VARCHAR(255) DEFAULT NULL, description VARCHAR(255) DEFAULT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE lnk_moyen_transport_tbl_operation_vente (ref_moyen_transport_id INT NOT NULL, tbl_operation_vente_id INT NOT NULL, INDEX IDX_6B7C3D426C645A7F (ref_moyen_transport_id), INDEX IDX_6B7C3D42860E9B21 (tbl_operation_vente_id), PRIMARY KEY(ref_moyen_transport_id, tbl_operation_vente_id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE lnk_moyen_transport_tbl_operation_vente ADD CONSTRAINT FK_6B7C3D426C645A7F FOREIGN KEY (ref_moyen_transport_id) REFERENCES ref_moyen_transport (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE lnk_moyen_transport_tbl_operation_vente ADD CONSTRAINT FK_6B7C3D42860E9B21 FOREIGN KEY (tbl_operation_vente_id) REFERENCES tbl_operation_vente (id) ON DELETE CASCADE');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE lnk_moyen_transport_tbl_operation_vente DROP FOREIGN KEY FK_6B7C3D426C645A7F');
$this->addSql('ALTER TABLE lnk_moyen_transport_tbl_operation_vente DROP FOREIGN KEY FK_6B7C3D42860E9B21');
$this->addSql('DROP TABLE ref_moyen_transport');
$this->addSql('DROP TABLE lnk_moyen_transport_tbl_operation_vente');
}
}