<?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 Version20241129085353 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
$this->addSql("ALTER TABLE `dp_week_days` ADD `sort_order` INT NOT NULL AFTER `week_day_type`;");
$this->addSql("UPDATE `dp_week_days` SET `sort_order` = '1' WHERE `dp_week_days`.`week_day_type` = 'Sunday';");
$this->addSql("UPDATE `dp_week_days` SET `sort_order` = '2' WHERE `dp_week_days`.`week_day_type` = 'Monday';");
$this->addSql("UPDATE `dp_week_days` SET `sort_order` = '3' WHERE `dp_week_days`.`week_day_type` = 'Tuesday';");
$this->addSql("UPDATE `dp_week_days` SET `sort_order` = '4' WHERE `dp_week_days`.`week_day_type` = 'Wednesday';");
$this->addSql("UPDATE `dp_week_days` SET `sort_order` = '5' WHERE `dp_week_days`.`week_day_type` = 'Thursday';");
$this->addSql("UPDATE `dp_week_days` SET `sort_order` = '6' WHERE `dp_week_days`.`week_day_type` = 'Friday';");
$this->addSql("UPDATE `dp_week_days` SET `sort_order` = '7' WHERE `dp_week_days`.`week_day_type` = 'Saturday';");
}
public function down(Schema $schema): void
{
$this->addSql("UPDATE `dp_week_days` SET `sort_order` = NULL WHERE `week_day_type` = 'Sunday';");
$this->addSql("UPDATE `dp_week_days` SET `sort_order` = NULL WHERE `week_day_type` = 'Monday';");
$this->addSql("UPDATE `dp_week_days` SET `sort_order` = NULL WHERE `week_day_type` = 'Tuesday';");
$this->addSql("UPDATE `dp_week_days` SET `sort_order` = NULL WHERE `week_day_type` = 'Wednesday';");
$this->addSql("UPDATE `dp_week_days` SET `sort_order` = NULL WHERE `week_day_type` = 'Thursday';");
$this->addSql("UPDATE `dp_week_days` SET `sort_order` = NULL WHERE `week_day_type` = 'Friday';");
$this->addSql("UPDATE `dp_week_days` SET `sort_order` = NULL WHERE `week_day_type` = 'Saturday';");
$this->addSql("ALTER TABLE `dp_week_days` DROP COLUMN `sort_order`;");
}
}