migrations/Version20220607174248.php line 1

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace DoctrineMigrations;
  4. use Doctrine\DBAL\Schema\Schema;
  5. use Doctrine\Migrations\AbstractMigration;
  6. /**
  7.  * Auto-generated Migration: Please modify to your needs!
  8.  */
  9. final class Version20220607174248 extends AbstractMigration
  10. {
  11.     public function getDescription(): string
  12.     {
  13.         return '';
  14.     }
  15.     public function up(Schema $schema): void
  16.     {
  17.         // this up() migration is auto-generated, please modify it to your needs
  18.         $this->addSql('CREATE TABLE identification (id INT AUTO_INCREMENT NOT NULL, acheteur_id INT DEFAULT NULL, vendeur_id INT DEFAULT NULL, dossier_id INT DEFAULT NULL, INDEX IDX_49E7720D96A7BB5F (acheteur_id), INDEX IDX_49E7720D858C065E (vendeur_id), INDEX IDX_49E7720D611C0C56 (dossier_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
  19.         $this->addSql('CREATE TABLE piece (id INT AUTO_INCREMENT NOT NULL, dossier_id INT DEFAULT NULL, client_id INT DEFAULT NULL, libelle VARCHAR(255) NOT NULL, path VARCHAR(255) NOT NULL, date_transmission DATETIME NOT NULL, INDEX IDX_44CA0B23611C0C56 (dossier_id), INDEX IDX_44CA0B2319EB6921 (client_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
  20.         $this->addSql('ALTER TABLE identification ADD CONSTRAINT FK_49E7720D96A7BB5F FOREIGN KEY (acheteur_id) REFERENCES client (id)');
  21.         $this->addSql('ALTER TABLE identification ADD CONSTRAINT FK_49E7720D858C065E FOREIGN KEY (vendeur_id) REFERENCES client (id)');
  22.         $this->addSql('ALTER TABLE identification ADD CONSTRAINT FK_49E7720D611C0C56 FOREIGN KEY (dossier_id) REFERENCES dossier (id)');
  23.         $this->addSql('ALTER TABLE piece ADD CONSTRAINT FK_44CA0B23611C0C56 FOREIGN KEY (dossier_id) REFERENCES dossier (id)');
  24.         $this->addSql('ALTER TABLE piece ADD CONSTRAINT FK_44CA0B2319EB6921 FOREIGN KEY (client_id) REFERENCES client (id)');
  25.     }
  26.     public function down(Schema $schema): void
  27.     {
  28.         // this down() migration is auto-generated, please modify it to your needs
  29.         $this->addSql('DROP TABLE identification');
  30.         $this->addSql('DROP TABLE piece');
  31.     }
  32. }