<?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 Version20211124091945 extends AbstractMigration
{
public function getDescription() : string
{
return '';
}
public function up(Schema $schema) : void
{
$this->addSql("
SET @id_ct_forms = (SELECT id FROM std_content_types WHERE machine_name='forms');
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
(
@id_ct_forms,
'form_redirect',
'COMBO',
24,
1,
1,
NOW(),
1,
NOW(),
'form_redirect',
'{\"sql\": \"select sp.name as descricao,sp.id as codigo from std_pages sp LEFT OUTER JOIN std_content_types sct ON sp.content_type = sct.id where sct.machine_name =\'pages\' order by sp.name\", \"type\": \"dynamic\"}'
);
");
}
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');
delete from `std_content_types_components` where `content_type_id`=@id_ct_forms AND `machine_name`='form_redirect';
");
}
}