migrations/Version20220215125049.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 Version20220215125049 extends AbstractMigration
  10. {
  11.     public function getDescription() : string
  12.     {
  13.         return '';
  14.     }
  15.     public function up(Schema $schema) : void
  16.     {
  17.         // this up() migration is auto-generated, please modify it to your needs
  18.         $this->addSql("
  19.         SET @content_type_id2 = (SELECT id FROM std_content_types WHERE machine_name='pages' LIMIT 1);
  20.         INSERT IGNORE INTO `std_content_types_components` (`content_type_id`, `machine_name`, `component_type`, `order_value`, `is_active`, `created_by`, `created_date`, `updated_by`, `updated_date`, `name`, `settings`) VALUES 
  21.         (@content_type_id2, 'default_image', 'IMAGE', 1, 1, 1, NOW(), 1,  NOW(), 'Image', NULL),
  22.         (@content_type_id2, 'short_text', 'TEXTAREA', 1, 1, 1, NOW(), 1,  NOW(), 'Text', '{\"ckeditor\": \"basic\"}'); 
  23.         ");
  24.     }
  25.     public function down(Schema $schema) : void
  26.     {
  27.         // this down() migration is auto-generated, please modify it to your needs
  28.         $this->addSql("SET @content_type_id2 = (SELECT id FROM std_content_types WHERE machine_name='pages' LIMIT 1);");
  29.         $this->addSql("DELETE FROM `std_content_types_components` WHERE `content_type_id` = @content_type_id2 AND `machine_name` in('default_image','short_text');");
  30.     }
  31. }