migrations/Version20220522134359.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 Version20220522134359 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 acte_constitution (id INT AUTO_INCREMENT NOT NULL, objet VARCHAR(255) NOT NULL, capital DOUBLE PRECISION NOT NULL, devise VARCHAR(255) NOT NULL, nature_action VARCHAR(255) NOT NULL, liberation_souscription VARCHAR(255) NOT NULL, nom_gerant VARCHAR(255) NOT NULL, siege VARCHAR(255) NOT NULL, duree VARCHAR(255) NOT NULL, denomination VARCHAR(255) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
  19.         $this->addSql('CREATE TABLE documents (id INT AUTO_INCREMENT NOT NULL, type_id INT DEFAULT NULL, libelle VARCHAR(255) NOT NULL, date_obtention DATETIME DEFAULT NULL, path VARCHAR(255) DEFAULT NULL, INDEX IDX_A2B07288C54C8C93 (type_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
  20.         $this->addSql('CREATE TABLE type_societe (id INT AUTO_INCREMENT NOT NULL, libelle VARCHAR(255) NOT NULL, sigle VARCHAR(255) NOT NULL, active VARCHAR(255) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
  21.         $this->addSql('ALTER TABLE documents ADD CONSTRAINT FK_A2B07288C54C8C93 FOREIGN KEY (type_id) REFERENCES type_societe (id)');
  22.         $this->addSql('ALTER TABLE acte DROP FOREIGN KEY FK_9EC413268F46D732');
  23.         $this->addSql('DROP INDEX IDX_9EC413268F46D732 ON acte');
  24.         $this->addSql('ALTER TABLE acte DROP type_acte_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('ALTER TABLE documents DROP FOREIGN KEY FK_A2B07288C54C8C93');
  30.         $this->addSql('DROP TABLE acte_constitution');
  31.         $this->addSql('DROP TABLE documents');
  32.         $this->addSql('DROP TABLE type_societe');
  33.         $this->addSql('ALTER TABLE acte ADD type_acte_id INT DEFAULT NULL');
  34.         $this->addSql('ALTER TABLE acte ADD CONSTRAINT FK_9EC413268F46D732 FOREIGN KEY (type_acte_id) REFERENCES type (id)');
  35.         $this->addSql('CREATE INDEX IDX_9EC413268F46D732 ON acte (type_acte_id)');
  36.     }
  37. }