migrations/Version20220331084313.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 Version20220331084313 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('ALTER TABLE document ADD payout_id INT DEFAULT NULL');
  19.         $this->addSql('ALTER TABLE document ADD CONSTRAINT FK_D8698A76C6D61B7F FOREIGN KEY (payout_id) REFERENCES payout (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
  20.         $this->addSql('CREATE INDEX IDX_D8698A76C6D61B7F ON document (payout_id)');
  21.         $this->addSql('ALTER TABLE payout ALTER payout_id DROP NOT NULL');
  22.         $this->addSql('ALTER TABLE payout ALTER payout_type_id DROP NOT NULL');
  23.         $this->addSql('ALTER TABLE payout ALTER payout_type DROP NOT NULL');
  24.         $this->addSql('ALTER TABLE payout ALTER payout_date DROP NOT NULL');
  25.         $this->addSql('ALTER TABLE payout ALTER bankaccount_id DROP NOT NULL');
  26.         $this->addSql('ALTER TABLE payout ALTER unique_mandate_reference DROP NOT NULL');
  27.         $this->addSql('ALTER TABLE payout ALTER bankaccount_iban DROP NOT NULL');
  28.         $this->addSql('ALTER TABLE payout ALTER currency DROP NOT NULL');
  29.         $this->addSql('ALTER TABLE notification RENAME COLUMN "to" TO device_id');
  30.         $this->addSql('ALTER TABLE notification ALTER multicast_id TYPE BIGINT');
  31.         $this->addSql('ALTER TABLE notification ALTER multicast_id DROP DEFAULT');
  32.     }
  33.     public function down(Schema $schema): void
  34.     {
  35.         // this down() migration is auto-generated, please modify it to your needs
  36.         $this->addSql('CREATE SCHEMA public');
  37.         $this->addSql('ALTER TABLE document DROP CONSTRAINT FK_D8698A76C6D61B7F');
  38.         $this->addSql('DROP INDEX IDX_D8698A76C6D61B7F');
  39.         $this->addSql('ALTER TABLE document DROP payout_id');
  40.         $this->addSql('ALTER TABLE payout ALTER payout_id SET NOT NULL');
  41.         $this->addSql('ALTER TABLE payout ALTER payout_type_id SET NOT NULL');
  42.         $this->addSql('ALTER TABLE payout ALTER payout_type SET NOT NULL');
  43.         $this->addSql('ALTER TABLE payout ALTER payout_date SET NOT NULL');
  44.         $this->addSql('ALTER TABLE payout ALTER bankaccount_id SET NOT NULL');
  45.         $this->addSql('ALTER TABLE payout ALTER unique_mandate_reference SET NOT NULL');
  46.         $this->addSql('ALTER TABLE payout ALTER bankaccount_iban SET NOT NULL');
  47.         $this->addSql('ALTER TABLE payout ALTER currency SET NOT NULL');
  48.         $this->addSql('ALTER TABLE notification RENAME COLUMN device_id TO "to"');
  49.         $this->addSql('ALTER TABLE notification ALTER multicast_id TYPE INT');
  50.         $this->addSql('ALTER TABLE notification ALTER multicast_id DROP DEFAULT');
  51.     }
  52. }