<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
final class Version20251201114029 extends AbstractMigration
{
public function getDescription(): string
{
return 'Adds boolean fields: accepted_by_deliveryman and is_auto_order to command table; adds auto_accept to restaurant_config table';
}
public function up(Schema $schema): void
{
// Add fields to command table
$this->addSql("
ALTER TABLE `command`
ADD `accepted_by_deliveryman` TINYINT(1) DEFAULT NULL
");
$this->addSql("
ALTER TABLE `command`
ADD `is_auto_order` TINYINT(1) DEFAULT NULL
");
// Add field to restaurant_config table
$this->addSql("
ALTER TABLE `restaurant_config`
ADD `auto_accept` TINYINT(1) DEFAULT NULL
");
}
public function down(Schema $schema): void
{
// Remove fields from command table
$this->addSql("
ALTER TABLE `command`
DROP COLUMN `accepted_by_deliveryman`,
DROP COLUMN `is_auto_order`
");
// Remove field from restaurant_config table
$this->addSql("
ALTER TABLE `restaurant_config`
DROP COLUMN `auto_accept`
");
}
}