<?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 Version20240905090029 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
$this->addSql('CREATE TABLE horaire_livraison (id INT AUTO_INCREMENT NOT NULL, societe_livraison_id INT NOT NULL, jour INT NOT NULL, heure_debut TIME NOT NULL, heure_fin TIME NOT NULL, INDEX IDX_3C37A521448E9678 (societe_livraison_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE non_disponibilite (id INT AUTO_INCREMENT NOT NULL, livreur_id INT NOT NULL, date_debut DATETIME NOT NULL, date_fin DATETIME NOT NULL, INDEX IDX_B1991EC8F8646701 (livreur_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE horaire_livraison ADD CONSTRAINT FK_3C37A521448E9678 FOREIGN KEY (societe_livraison_id) REFERENCES societe_livraison (id)');
$this->addSql('ALTER TABLE non_disponibilite ADD CONSTRAINT FK_B1991EC8F8646701 FOREIGN KEY (livreur_id) REFERENCES user (id)');
}
public function down(Schema $schema): void
{
$this->addSql('ALTER TABLE horaire_livraison DROP FOREIGN KEY FK_3C37A521448E9678');
$this->addSql('ALTER TABLE non_disponibilite DROP FOREIGN KEY FK_B1991EC8F8646701');
$this->addSql('DROP TABLE horaire_livraison');
$this->addSql('DROP TABLE non_disponibilite');
}
}