migrations/Version20250412200359.php line 1

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace DoctrineMigrations;
  4. use Doctrine\DBAL\Schema\Schema;
  5. use Doctrine\Migrations\AbstractMigration;
  6. /**
  7.  * Auto-generated Migration: Please modify to your needs!
  8.  */
  9. final class Version20250412200359 extends AbstractMigration
  10. {
  11.     public function getDescription(): string
  12.     {
  13.         return '';
  14.     }
  15.     public function up(Schema $schema): void
  16.     {
  17.         $this->addSql('ALTER TABLE tourapp.email_queue ADD travel_focus_id INT DEFAULT NULL');
  18.         $this->addSql('ALTER TABLE tourapp.travel ADD opt_generate_agreement BOOLEAN DEFAULT true NOT NULL');
  19.         $this->addSql('
  20.             update tourapp.travel set 
  21.             opt_generate_agreement = false
  22.             where travel_id not in (
  23.                 select
  24.                     t.travel_id
  25.                 from tourapp.travel t
  26.                 join tourapp.travel_files tf using(travel_id)
  27.                 --where tf.travel_file_type_id in (3,2)
  28.             )
  29.         ');
  30.         $this->addSql('ALTER TABLE tourapp.app_settings ADD app_company_details VARCHAR(255) DEFAULT NULL');
  31.         $this->addSql("INSERT INTO tourapp.log_types (id, log_type_name) VALUES
  32.             (51, 'Modyfikacja Ustawienia->Dane firmy'),
  33.             (52, 'Modyfikacja Ustawienia->Wizerunek firmy'),
  34.             (53, 'Modyfikacja Ustawienia->Ubezpieczenie od kosztów rezygnacji'),
  35.             (54, 'Modyfikacja Ustawienia->Dokumenty'),
  36.             (55, 'Modyfikacja Ustawienia->SMS Planet');
  37.         ");
  38.     }
  39.     public function down(Schema $schema): void
  40.     {
  41.         $this->addSql('ALTER TABLE tourapp.email_queue DROP travel_focus_id');
  42.         $this->addSql('ALTER TABLE tourapp.travel DROP opt_generate_agreement');
  43.         $this->addSql('ALTER TABLE tourapp.app_settings DROP app_company_details');
  44.     }
  45. }