migrations/Version20220630082158.php line 1
<?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 Version20220630082158 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 ledger__account DROP CONSTRAINT fk_586eb223217bbb47');
$this->addSql('DROP INDEX uniq_586eb223217bbb47');
$this->addSql('ALTER TABLE ledger__account RENAME COLUMN person_id TO owner_id');
$this->addSql('ALTER TABLE ledger__account ADD CONSTRAINT FK_586EB2237E3C61F9 FOREIGN KEY (owner_id) REFERENCES "user" (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('CREATE UNIQUE INDEX UNIQ_586EB2237E3C61F9 ON ledger__account (owner_id)');
$this->addSql('ALTER TABLE shop__order DROP CONSTRAINT fk_fab35986217bbb47');
$this->addSql('DROP INDEX idx_fab35986217bbb47');
$this->addSql('ALTER TABLE shop__order RENAME COLUMN person_id TO buyer_id');
$this->addSql('ALTER TABLE shop__order ADD CONSTRAINT FK_FAB359866C755722 FOREIGN KEY (buyer_id) REFERENCES "user" (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('CREATE INDEX IDX_FAB359866C755722 ON shop__order (buyer_id)');
$this->addSql('ALTER TABLE ledger__transaction ALTER comment DROP NOT NULL');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE ledger__account DROP CONSTRAINT FK_586EB2237E3C61F9');
$this->addSql('DROP INDEX UNIQ_586EB2237E3C61F9');
$this->addSql('ALTER TABLE ledger__account RENAME COLUMN owner_id TO person_id');
$this->addSql('ALTER TABLE ledger__account ADD CONSTRAINT fk_586eb223217bbb47 FOREIGN KEY (person_id) REFERENCES "user" (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('CREATE UNIQUE INDEX uniq_586eb223217bbb47 ON ledger__account (person_id)');
$this->addSql('ALTER TABLE shop__order DROP CONSTRAINT FK_FAB359866C755722');
$this->addSql('DROP INDEX IDX_FAB359866C755722');
$this->addSql('ALTER TABLE shop__order RENAME COLUMN buyer_id TO person_id');
$this->addSql('ALTER TABLE shop__order ADD CONSTRAINT fk_fab35986217bbb47 FOREIGN KEY (person_id) REFERENCES "user" (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('CREATE INDEX idx_fab35986217bbb47 ON shop__order (person_id)');
$this->addSql('ALTER TABLE ledger__transaction ALTER comment SET NOT NULL');
}
}