Version20221205112952.php 2.1 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12
<?php

declare(strict_types=1);

namespace DoctrineMigrations;

use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;

/**
 * Auto-generated Migration: Please modify to your needs!
 */
13
final class Version20221205112952 extends AbstractMigration
14 15 16 17 18 19 20 21 22
{
    public function getDescription() : string
    {
        return '';
    }

    public function up(Schema $schema) : void
    {
        // this up() migration is auto-generated, please modify it to your needs
23 24
        $this->addSql('ALTER TABLE adherent DROP FOREIGN KEY FK_90D3F060D0B364B6');
        $this->addSql('ALTER TABLE adherent ADD CONSTRAINT FK_90D3F060D0B364B6 FOREIGN KEY (profildecotisation_id) REFERENCES profildecotisation (id) ON DELETE SET NULL');
25 26
        $this->addSql('ALTER TABLE prestataire CHANGE iban iban LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:personal_data)\'');
        $this->addSql('DROP INDEX UNIQ_386FBA47989D9B62 ON profildecotisation');
27
        $this->addSql('ALTER TABLE profildecotisation DROP name, DROP slug, DROP content, DROP enabled, CHANGE maxpercevablemensuel montant INT NOT NULL');
28 29 30 31 32
    }

    public function down(Schema $schema) : void
    {
        // this down() migration is auto-generated, please modify it to your needs
33 34
        $this->addSql('ALTER TABLE adherent DROP FOREIGN KEY FK_90D3F060D0B364B6');
        $this->addSql('ALTER TABLE adherent ADD CONSTRAINT FK_90D3F060D0B364B6 FOREIGN KEY (profildecotisation_id) REFERENCES profildecotisation (id)');
35
        $this->addSql('ALTER TABLE prestataire CHANGE iban iban LONGTEXT CHARACTER SET utf8mb3 DEFAULT NULL COLLATE `utf8mb3_general_ci` COMMENT \'(DC2Type:personal_data)\'');
36
        $this->addSql('ALTER TABLE profildecotisation ADD name VARCHAR(150) CHARACTER SET utf8mb3 NOT NULL COLLATE `utf8mb3_general_ci`, ADD slug VARCHAR(150) CHARACTER SET utf8mb3 NOT NULL COLLATE `utf8mb3_general_ci`, ADD content LONGTEXT CHARACTER SET utf8mb3 DEFAULT NULL COLLATE `utf8mb3_general_ci`, ADD enabled TINYINT(1) NOT NULL, CHANGE montant maxPercevableMensuel INT NOT NULL');
37 38 39
        $this->addSql('CREATE UNIQUE INDEX UNIQ_386FBA47989D9B62 ON profildecotisation (slug)');
    }
}