<?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 Version20221129142346 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
$this->addSql('ALTER TABLE reference_property_status ADD rank INT DEFAULT NULL');
$this->addSql("UPDATE reference_property_status SET rank = 1 WHERE name = 'reference.property.status.INVALIDE'");
$this->addSql("UPDATE reference_property_status SET rank = 2 WHERE name = 'reference.property.status.PENDING'");
$this->addSql("UPDATE reference_property_status SET rank = 3 WHERE name = 'reference.property.status.IN_PROGRESS'");
$this->addSql("UPDATE reference_property_status SET rank = 4 WHERE name = 'reference.property.status.RESERVED'");
$this->addSql("UPDATE reference_property_status SET rank = 5 WHERE name = 'reference.property.status.UNDER_COMPROMISE'");
$this->addSql("UPDATE reference_property_status SET rank = 6 WHERE name = 'reference.property.status.SOLD_BY_MILKIYA'");
$this->addSql("UPDATE reference_property_status SET rank = 7 WHERE name = 'reference.property.status.SOLD_BY_COMPETITION'");
$this->addSql("UPDATE reference_property_status SET rank = 8 WHERE name = 'reference.property.status.ARCHIVED'");
}
public function down(Schema $schema): void
{
$this->addSql('CREATE SCHEMA public');
$this->addSql('ALTER TABLE reference_property_status DROP rank');
}
}