<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20210305145915 extends AbstractMigration
{
public function getDescription() : string
{
return '';
}
public function up(Schema $schema) : void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql("
SET @id_ct_forms = (SELECT id FROM std_content_types WHERE machine_name='forms');
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\"}'
where `content_type_id`=@id_ct_forms and `machine_name`='form_type';
");
}
public function down(Schema $schema) : void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql("
SET @id_ct_forms = (SELECT id FROM std_content_types WHERE machine_name='forms');
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\"}'
where `content_type_id`=@id_ct_forms and `machine_name`='form_type';
");
}
}