migrations/Version20210305145915.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 Version20210305145915 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 @id_ct_forms = (SELECT id FROM std_content_types WHERE machine_name='forms');
  20.         update  `std_content_types_components` set `settings`='{\"sql\": \"SELECT dv.machine_name AS codigo, dv.description AS descricao FROM std_domains_values dv INNER JOIN std_domains d ON dv.domain_id=d.id WHERE d.machine_name=''form_type'' AND d.language_code=(SELECT language_code FROM std_languages WHERE is_default=1 and is_active=1 AND is_public=1 LIMIT 1) AND dv.language_code=(SELECT language_code FROM std_languages WHERE is_default=1 and is_active=1 AND is_public=1 LIMIT 1) AND dv.is_active=1 AND d.is_active=1 ORDER BY dv.description \", \"type\": \"dynamic\"}' 
  21.         where `content_type_id`=@id_ct_forms and `machine_name`='form_type';
  22.         ");
  23.     }
  24.     public function down(Schema $schema) : void
  25.     {
  26.         // this down() migration is auto-generated, please modify it to your needs
  27.         $this->addSql("
  28.         SET @id_ct_forms = (SELECT id FROM std_content_types WHERE machine_name='forms');
  29.         update  `std_content_types_components` set `settings`='{\"sql\": \"SELECT dv.machine_name AS codigo, dv.description AS descricao FROM std_domains_values dv INNER JOIN std_domains d ON dv.domain_id=d.id WHERE d.machine_name=''form_type'' AND d.language_code=(SELECT language_code FROM std_languages WHERE is_active=1 AND is_public=1 LIMIT 1) AND dv.language_code=(SELECT language_code FROM std_languages WHERE is_active=1 AND is_public=1 LIMIT 1) AND dv.is_active=1 AND d.is_active=1 ORDER BY dv.description \", \"type\": \"dynamic\"}' 
  30.         where `content_type_id`=@id_ct_forms and `machine_name`='form_type';
  31.         ");
  32.     }
  33. }