migrations/Version20240221090339.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 Version20240221090339 extends AbstractMigration
  10. {
  11.     public function getDescription(): string
  12.     {
  13.         return '';
  14.     }
  15.     public function up(Schema $schema): void
  16.     {
  17.         //removed this section as per client changes
  18.         // $cms_pages = $this->connection->fetchAssociative(
  19.         //     'SELECT id FROM cms_pages WHERE slug = :slug',
  20.         //     ['slug' => 'resource_directory_sourcing']
  21.         // );
  22.         // $entries = [
  23.         //     ['cms_id_id' => $cms_pages['id'], 'section_name' => 'Section 2', 'section_slug' => 'section_2', 'backend_template' => 'section_2', 'frontend_template' => 'section_2', 'position' => '2','deleted_at'=>null]
  24.            
  25.             
  26.             
  27.         // ];
  28.         // foreach ($entries as $entry) {
  29.         //     $existingEntry = $this->connection->fetchAssociative(
  30.         //         'SELECT * FROM cms_sections WHERE cms_id_id = :cms_id_id AND section_name = :section_name',
  31.         //         ['cms_id_id' => $cms_pages['id'], 'section_name' => $entry['section_name']]
  32.         //     );
  33.         //     if (!$existingEntry) {
  34.         //         $this->addSql('INSERT INTO cms_sections (cms_id_id, section_name , section_slug,backend_template,frontend_template,position,deleted_at) VALUES (:cms_id_id, :section_name, :section_slug, :backend_template,:frontend_template,:position,deleted_at)', [
  35.         //             'cms_id_id' => $entry['cms_id_id'],
  36.         //             'section_name' => $entry['section_name'],
  37.         //             'section_slug' => $entry['section_slug'],
  38.         //             'backend_template' => $entry['backend_template'],
  39.         //             'frontend_template' => $entry['frontend_template'],
  40.         //             'position' => $entry['position'],
  41.         //             'deleted_at' => $entry['deleted_at'],
  42.         //         ]);
  43.         //     }
  44.         // }
  45.     }
  46.     public function down(Schema $schema): void
  47.     {
  48.         // this down() migration is auto-generated, please modify it to your needs
  49.        
  50.     }
  51. }