migrations/Version20240407150618.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 Version20240407150618 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 tbl_lapin (id INT AUTO_INCREMENT NOT NULL, sexe_id INT DEFAULT NULL, type_lapin_id INT DEFAULT NULL, mere_id INT DEFAULT NULL, date_naissance DATE NOT NULL, INDEX IDX_FDDA43C9448F3B3C (sexe_id), INDEX IDX_FDDA43C9DFA18EDF (type_lapin_id), INDEX IDX_FDDA43C939DEC40E (mere_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
  19.         $this->addSql('ALTER TABLE tbl_lapin ADD CONSTRAINT FK_FDDA43C9448F3B3C FOREIGN KEY (sexe_id) REFERENCES ref_sexe_lapin (id)');
  20.         $this->addSql('ALTER TABLE tbl_lapin ADD CONSTRAINT FK_FDDA43C9DFA18EDF FOREIGN KEY (type_lapin_id) REFERENCES ref_type_lapin (id)');
  21.         $this->addSql('ALTER TABLE tbl_lapin ADD CONSTRAINT FK_FDDA43C939DEC40E FOREIGN KEY (mere_id) REFERENCES tbl_lapin_production (id)');
  22.         $this->addSql('ALTER TABLE tbl_production ADD adoption_enfants INT DEFAULT NULL AFTER mort_enfants');
  23.     }
  24.     public function down(Schema $schema): void
  25.     {
  26.         // this down() migration is auto-generated, please modify it to your needs
  27.        
  28.     }
  29. }