<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20220331084313 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE document ADD payout_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE document ADD CONSTRAINT FK_D8698A76C6D61B7F FOREIGN KEY (payout_id) REFERENCES payout (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('CREATE INDEX IDX_D8698A76C6D61B7F ON document (payout_id)');
$this->addSql('ALTER TABLE payout ALTER payout_id DROP NOT NULL');
$this->addSql('ALTER TABLE payout ALTER payout_type_id DROP NOT NULL');
$this->addSql('ALTER TABLE payout ALTER payout_type DROP NOT NULL');
$this->addSql('ALTER TABLE payout ALTER payout_date DROP NOT NULL');
$this->addSql('ALTER TABLE payout ALTER bankaccount_id DROP NOT NULL');
$this->addSql('ALTER TABLE payout ALTER unique_mandate_reference DROP NOT NULL');
$this->addSql('ALTER TABLE payout ALTER bankaccount_iban DROP NOT NULL');
$this->addSql('ALTER TABLE payout ALTER currency DROP NOT NULL');
$this->addSql('ALTER TABLE notification RENAME COLUMN "to" TO device_id');
$this->addSql('ALTER TABLE notification ALTER multicast_id TYPE BIGINT');
$this->addSql('ALTER TABLE notification ALTER multicast_id DROP DEFAULT');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE SCHEMA public');
$this->addSql('ALTER TABLE document DROP CONSTRAINT FK_D8698A76C6D61B7F');
$this->addSql('DROP INDEX IDX_D8698A76C6D61B7F');
$this->addSql('ALTER TABLE document DROP payout_id');
$this->addSql('ALTER TABLE payout ALTER payout_id SET NOT NULL');
$this->addSql('ALTER TABLE payout ALTER payout_type_id SET NOT NULL');
$this->addSql('ALTER TABLE payout ALTER payout_type SET NOT NULL');
$this->addSql('ALTER TABLE payout ALTER payout_date SET NOT NULL');
$this->addSql('ALTER TABLE payout ALTER bankaccount_id SET NOT NULL');
$this->addSql('ALTER TABLE payout ALTER unique_mandate_reference SET NOT NULL');
$this->addSql('ALTER TABLE payout ALTER bankaccount_iban SET NOT NULL');
$this->addSql('ALTER TABLE payout ALTER currency SET NOT NULL');
$this->addSql('ALTER TABLE notification RENAME COLUMN device_id TO "to"');
$this->addSql('ALTER TABLE notification ALTER multicast_id TYPE INT');
$this->addSql('ALTER TABLE notification ALTER multicast_id DROP DEFAULT');
}
}