<?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 Version20211213094903 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 agences (id INT AUTO_INCREMENT NOT NULL, intitule VARCHAR(255) NOT NULL, adresse VARCHAR(255) NOT NULL, code_postal VARCHAR(255) NOT NULL, ville VARCHAR(255) NOT NULL, telephone VARCHAR(10) NOT NULL, google_map VARCHAR(255) NOT NULL, etat INT NOT NULL, email VARCHAR(255) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE stagiaires (id INT AUTO_INCREMENT NOT NULL, agence_id INT NOT NULL, nom VARCHAR(255) NOT NULL, prenom VARCHAR(255) NOT NULL, email VARCHAR(255) NOT NULL, adresse1 VARCHAR(255) NOT NULL, adresse2 VARCHAR(255) DEFAULT NULL, code_postal VARCHAR(255) NOT NULL, ville VARCHAR(6) NOT NULL, etat VARCHAR(255) NOT NULL, date_creation DATETIME NOT NULL, agrement_num VARCHAR(255) NOT NULL, domaine VARCHAR(255) DEFAULT NULL, diplome1 VARCHAR(255) DEFAULT NULL, diplome2 VARCHAR(255) DEFAULT NULL, diplome3 VARCHAR(255) DEFAULT NULL, telephone VARCHAR(10) DEFAULT NULL, dispense_domaine1 TINYINT(1) DEFAULT NULL, dispense_domaine2 TINYINT(1) DEFAULT NULL, dispense_domaine3 TINYINT(1) DEFAULT NULL, INDEX IDX_4A9FADC6D725330D (agence_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE stagiaires ADD CONSTRAINT FK_4A9FADC6D725330D FOREIGN KEY (agence_id) REFERENCES agences (id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE stagiaires DROP FOREIGN KEY FK_4A9FADC6D725330D');
$this->addSql('DROP TABLE agences');
$this->addSql('DROP TABLE stagiaires');
}
}