32 lines
973 B
PHP
32 lines
973 B
PHP
<?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 Version20260707094812 extends AbstractMigration
|
||
{
|
||
public function getDescription(): string
|
||
{
|
||
return 'Drop children_count (4–5 J.) and rename adolescents_count to children_count (now 4–X J.)';
|
||
}
|
||
|
||
public function up(Schema $schema): void
|
||
{
|
||
$this->addSql('ALTER TABLE accommodation_booking DROP COLUMN children_count');
|
||
$this->addSql('ALTER TABLE accommodation_booking RENAME COLUMN adolescents_count TO children_count');
|
||
}
|
||
|
||
public function down(Schema $schema): void
|
||
{
|
||
$this->addSql('ALTER TABLE accommodation_booking RENAME COLUMN children_count TO adolescents_count');
|
||
$this->addSql('ALTER TABLE accommodation_booking ADD COLUMN children_count INT NOT NULL DEFAULT 0');
|
||
}
|
||
}
|