<?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 Version20230721134918 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 shop_mode ADD order_interval INT DEFAULT 20 NOT NULL');
$this->addSql('UPDATE shop_mode SET order_interval = IFNULL((SELECT IFNULL(shop_settings.order_interval, 20) FROM shop_settings WHERE shop_settings.shop_id = shop_mode.shop_id), 20)');
$this->addSql('ALTER TABLE shop_settings DROP order_interval');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE shop_mode DROP order_interval');
$this->addSql('ALTER TABLE shop_settings ADD order_interval INT DEFAULT NULL');
}
}