migrations/Version20250801102749.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 Version20250801102749 extends AbstractMigration
  10. {
  11.     public function getDescription(): string
  12.     {
  13.         return '';
  14.     }
  15.     public function up(Schema $schema): void
  16.     {
  17.         $now = (new \DateTime())->format('Y-m-d H:i:s');
  18.         // insert new menu option
  19.         
  20.          $this->addSql("
  21.             INSERT IGNORE INTO std_options (created_by, updated_by, machine_name, order_value, path, is_active, created_date, updated_date, menu_section, dropdown_section, icon, name, external_link)
  22.             VALUES           
  23.             
  24.             -- exclusive event content
  25.             (1, 1, 'exclusive_event_content', 11, null, 1, '$now', '$now', 'navigation', 'content', 'blog', 'exclusive_event_content', '/admin/content/exclusive_event_content');
  26.         ");
  27.     }
  28.     public function down(Schema $schema): void
  29.     {
  30.         // this down() migration is auto-generated, please modify it to your needs
  31.         $this->addSql("DELETE FROM std_options_permissions WHERE option_id in (SELECT id FROM std_options WHERE machine_name = 'exclusive_event_content' AND menu_section = 'navigation' AND dropdown_section = 'content')");
  32.         $this->addSql("DELETE FROM std_roles_permissions WHERE option_id in (SELECT id FROM std_options WHERE machine_name = 'exclusive_event_content' AND menu_section = 'navigation' AND dropdown_section = 'content')");
  33.         $this->addSql("DELETE FROM std_options WHERE machine_name = 'exclusive_event_content' AND menu_section = 'navigation' AND dropdown_section = 'content'");
  34.     }
  35. }