<?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 Version20250227150000 extends AbstractMigration
{
public function getDescription(): string
{
return 'Update all NULL values in reservation.deleted to 0';
}
public function up(Schema $schema): void
{
// Update NULL to 0 in the deleted column
$this->addSql('UPDATE reservation SET deleted = 0 WHERE deleted IS NULL');
}
public function down(Schema $schema): void
{
// This is to revert the changes (set 0 back to NULL)
$this->addSql('UPDATE reservation SET deleted = NULL WHERE deleted = 0');
}
}