<?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 Version20250412200359 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
$this->addSql('ALTER TABLE tourapp.email_queue ADD travel_focus_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE tourapp.travel ADD opt_generate_agreement BOOLEAN DEFAULT true NOT NULL');
$this->addSql('
update tourapp.travel set
opt_generate_agreement = false
where travel_id not in (
select
t.travel_id
from tourapp.travel t
join tourapp.travel_files tf using(travel_id)
--where tf.travel_file_type_id in (3,2)
)
');
$this->addSql('ALTER TABLE tourapp.app_settings ADD app_company_details VARCHAR(255) DEFAULT NULL');
$this->addSql("INSERT INTO tourapp.log_types (id, log_type_name) VALUES
(51, 'Modyfikacja Ustawienia->Dane firmy'),
(52, 'Modyfikacja Ustawienia->Wizerunek firmy'),
(53, 'Modyfikacja Ustawienia->Ubezpieczenie od kosztów rezygnacji'),
(54, 'Modyfikacja Ustawienia->Dokumenty'),
(55, 'Modyfikacja Ustawienia->SMS Planet');
");
}
public function down(Schema $schema): void
{
$this->addSql('ALTER TABLE tourapp.email_queue DROP travel_focus_id');
$this->addSql('ALTER TABLE tourapp.travel DROP opt_generate_agreement');
$this->addSql('ALTER TABLE tourapp.app_settings DROP app_company_details');
}
}