<?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 Version20210812164226 extends AbstractMigration
{
public function getDescription() : string
{
return '';
}
public function up(Schema $schema) : void
{
$this->addSql("
INSERT IGNORE INTO `std_config` (`machine_name`, `created_by`, `updated_by`, `description_machine_name`, `details_machine_name`, `parent_name`, `variable_type`, `order_value`, `is_hidden`, `created_date`, `updated_date`, `label`, `language_code`)
VALUES
('logoemail', '1', '1', 'logoemail', 'logoemail', 'Theme', 'IMAGE', '5', '0', now(), now(), 'Logo Email', '')
");
$this->addSql("
INSERT IGNORE INTO `std_config` (`machine_name`, `created_by`, `updated_by`, `description_machine_name`, `details_machine_name`, `parent_name`, `variable_type`, `order_value`, `is_hidden`, `created_date`, `updated_date`, `label`, `language_code`)
VALUES
('favicon', '1', '1', 'favicon', 'favicon', 'Theme', 'IMAGE', '6', '0', now(), now(), 'Favicon 192x192', '')
");
$this->addSql("
INSERT IGNORE INTO `std_config` (`machine_name`, `created_by`, `updated_by`, `value`, `description_machine_name`, `details_machine_name`, `parent_name`, `variable_type`, `order_value`, `is_hidden`, `label`, `language_code`) VALUES
('facebook_url', '1', '1', '', 'facebook_url', 'redes_sociais', 'Redes Sociais', 'INPUT', '1', '0', 'URL Facebook',''),
('instagram_url', '1', '1', '', 'instagram_url', 'redes_sociais', 'Redes Sociais', 'INPUT', '2', '0', 'URL Instagram',''),
('linkedin_url', '1', '1', '', 'linkedin_url', 'redes_sociais', 'Redes Sociais', 'INPUT', '3', '0', 'URL Linkedin',''),
('youtube_url', '1', '1', '', 'youtube_url', 'redes_sociais', 'Redes Sociais', 'INPUT', '4', '0', 'URL Youtube',''),
('twitter_url', '1', '1', '', 'twitter_url', 'redes_sociais', 'Redes Sociais', 'INPUT', '5', '0', 'URL Twitter',''),
('footer_text', '1', '1', '', 'footer_text', 'footer', 'Footer', 'TEXTAREA', '3', '0', 'Footer text','pt'),
('footer_text', '1', '1', '', 'footer_text', 'footer', 'Footer', 'TEXTAREA', '3', '0', 'Footer text','en'),
('footer_text2', '1', '1', '', 'footer_text2', 'footer', 'Footer', 'TEXTAREA', '3', '0', 'Footer text 2','pt'),
('footer_text2', '1', '1', '', 'footer_text2', 'footer', 'Footer', 'TEXTAREA', '3', '0', 'Footer text 2','en');
");
$this->addSql("
INSERT INTO `std_config` (`machine_name`, `created_by`, `updated_by`, `value`, `description_machine_name`, `details_machine_name`, `parent_name`, `variable_type`, `order_value`, `is_hidden`, `label`, `content`, `language_code`) VALUES
('header_style', '1', '1', 'header_1', 'header_style', 'header_style', 'Theme', 'SELECT', '10', '0', 'Header Style','{\"query\": \"SELECT \'Header 1\' AS label,\'header_1\' AS `id` UNION SELECT \'Header 2\' AS label,\'header_2\' AS `id` UNION SELECT \'Header 3\' AS label,\'header_3\' AS `id` UNION SELECT \'Header Custom\' AS label,\'header_custom\' AS `id`\"}',''),
('footer_style', '1', '1', 'footer_1', 'footer_style', 'footer_style', 'Theme', 'SELECT', '11', '0', 'Footer Style','{\"query\": \"SELECT \'Footer 1\' AS label,\'footer_1\' AS `id` UNION SELECT \'Footer 2\' AS label,\'footer_2\' AS `id` UNION SELECT \'Footer 3\' AS label,\'footer_3\' AS `id` UNION SELECT \'Footer Custom\' AS label,\'footer_custom\' AS `id`\"}','');
");
// -- Breadcrumb
$this->addSql("
INSERT INTO `std_config` (`machine_name`, `created_by`, `updated_by`, `value`, `description_machine_name`, `details_machine_name`, `parent_name`, `variable_type`, `order_value`, `is_hidden`, `label`, `content`, `language_code`) VALUES
('breadcrumb', '1', '1', 'breadcrumb', 'breadcrumb', 'breadcrumb', 'Theme', 'CHECKBOX', '12', '0', 'Breadcrumb',NULL,''),
('breadcrumb_align', '1', '1', 'breadcrumb_align', 'breadcrumb_align', 'breadcrumb_align', 'Theme', 'SELECT', '13', '0', 'Breadcrumb Align', '{\"query\": \"SELECT \'Left\' AS label,\'start\' AS `id` UNION SELECT \'Right\' AS label,\'end\' AS `id` UNION SELECT \'Center\' AS label,\'center\' AS `id`\"}','');
");
// -- Footer 1
$this->addSql("
SET @id_ct_menus=(SELECT id FROM std_content_types WHERE machine_name='menus');
INSERT IGNORE INTO `std_pages` VALUES (NULL,NULL, 1, 1, @id_ct_menus, 1, now(), now(), NULL, now(), NULL,'Menu Footer 1','');
");
$this->addSql("
SET @id_page_mt = LAST_INSERT_ID();
INSERT IGNORE INTO `std_pages_content` VALUES (@id_page_mt, 'pt', 1, 1, 1, now(), now(), 'Menu Footer 1', '', NULL, '', '', '', '', '', '', '', '', '', '', '[]');
");
$this->addSql("
INSERT IGNORE INTO `std_pages_pages` VALUES (NULL,@id_page_mt, 0, 1, @id_ct_menus);
");
$this->addSql("
SET @id_pp_mt = LAST_INSERT_ID();
INSERT IGNORE INTO `std_content_types_skins` VALUES (@id_ct_menus, 'menufooter', 'Menu Footer', 1, 1, now(), 1, now());
");
$this->addSql("
INSERT IGNORE INTO `std_config` VALUES ('menufooter1', 1, 1, @id_pp_mt, 'menufooter1', 'menufooter1', 'Menus', 'SELECT', 62, 0, 1, now(), now(), 'Menu Footer 1', '{\"query\": \"select sp.name as label,spp.id as id from std_pages sp LEFT OUTER JOIN std_pages_pages spp ON sp.id = spp.page_id LEFT OUTER JOIN std_content_types sct ON sp.content_type = sct.id inner join std_pages_content spc on sp.id=spc.page_id and spc.language_code=\'pt\' where sct.machine_name=\'menus\' AND spp.relation_id = 0\"}','pt');
");
$this->addSql("
INSERT IGNORE INTO `std_config` VALUES ('menufooter1_skin', 1, 1, 'menufooter', 'menufooter1_skin', 'menufooter1_skin', 'Menus', 'SELECT', 63, 0, 1, now(), now(), 'Menu Footer 1 Skin', '{\"query\": \"select scts.name as label,scts.machine_name as id from std_content_types_skins scts LEFT OUTER JOIN std_content_types sct ON scts.content_type_id = sct.id WHERE sct.machine_name=\'menus\'\"}','pt');
");
// -- Footer 2
$this->addSql("
SET @id_ct_menus=(SELECT id FROM std_content_types WHERE machine_name='menus');
INSERT IGNORE INTO `std_pages` VALUES (NULL,NULL, 1, 1, @id_ct_menus, 1, now(), now(), NULL, now(), NULL,'Menu Footer 2','');
");
$this->addSql("
SET @id_page_mt = LAST_INSERT_ID();
INSERT IGNORE INTO `std_pages_content` VALUES (@id_page_mt, 'pt', 1, 1, 1, now(), now(), 'Menu Footer ', '', NULL, '', '', '', '', '', '', '', '', '', '', '[]');
");
$this->addSql("
INSERT IGNORE INTO `std_pages_pages` VALUES (NULL,@id_page_mt, 0, 1, @id_ct_menus);
");
$this->addSql("
SET @id_pp_mt = LAST_INSERT_ID();
INSERT IGNORE INTO `std_config` VALUES ('menufooter2', 1, 1, @id_pp_mt, 'menufooter2', 'menufooter2', 'Menus', 'SELECT', 68, 0, 1, now(), now(), 'Menu Footer 2', '{\"query\": \"select sp.name as label,spp.id as id from std_pages sp LEFT OUTER JOIN std_pages_pages spp ON sp.id = spp.page_id LEFT OUTER JOIN std_content_types sct ON sp.content_type = sct.id inner join std_pages_content spc on sp.id=spc.page_id and spc.language_code=\'pt\' where sct.machine_name=\'menus\' AND spp.relation_id = 0\"}','pt');
");
$this->addSql("
INSERT IGNORE INTO `std_config` VALUES ('menufooter2_skin', 1, 1, 'menufooter', 'menufooter2_skin', 'menufooter2_skin', 'Menus', 'SELECT', 69, 0, 1, now(), now(), 'Menu Footer 2 Skin', '{\"query\": \"select scts.name as label,scts.machine_name as id from std_content_types_skins scts LEFT OUTER JOIN std_content_types sct ON scts.content_type_id = sct.id WHERE sct.machine_name=\'menus\'\"}','pt');
");
// -- Footer 3
$this->addSql("
SET @id_ct_menus=(SELECT id FROM std_content_types WHERE machine_name='menus');
INSERT IGNORE INTO `std_pages` VALUES (NULL,NULL, 1, 1, @id_ct_menus, 1, now(), now(), NULL, now(), NULL,'Menu Footer 3','');
");
$this->addSql("
SET @id_page_mt = LAST_INSERT_ID();
INSERT IGNORE INTO `std_pages_content` VALUES (@id_page_mt, 'pt', 1, 1, 1, now(), now(), 'Menu Footer ', '', NULL, '', '', '', '', '', '', '', '', '', '', '[]');
");
$this->addSql("
INSERT IGNORE INTO `std_pages_pages` VALUES (NULL,@id_page_mt, 0, 1, @id_ct_menus);
");
$this->addSql("
SET @id_pp_mt = LAST_INSERT_ID();
INSERT IGNORE INTO `std_config` VALUES ('menufooter3', 1, 1, @id_pp_mt, 'menufooter3', 'menufooter3', 'Menus', 'SELECT', 74, 0, 1, now(), now(), 'Menu Footer 3', '{\"query\": \"select sp.name as label,spp.id as id from std_pages sp LEFT OUTER JOIN std_pages_pages spp ON sp.id = spp.page_id LEFT OUTER JOIN std_content_types sct ON sp.content_type = sct.id inner join std_pages_content spc on sp.id=spc.page_id and spc.language_code=\'pt\' where sct.machine_name=\'menus\' AND spp.relation_id = 0\"}','pt');
");
$this->addSql("
INSERT IGNORE INTO `std_config` VALUES ('menufooter3_skin', 1, 1, 'menufooter', 'menufooter3_skin', 'menufooter3_skin', 'Menus', 'SELECT', 75, 0, 1, now(), now(), 'Menu Footer 3 Skin', '{\"query\": \"select scts.name as label,scts.machine_name as id from std_content_types_skins scts LEFT OUTER JOIN std_content_types sct ON scts.content_type_id = sct.id WHERE sct.machine_name=\'menus\'\"}','pt');
");
}
public function down(Schema $schema) : void
{
$this->addSql("DELETE FROM `std_config` WHERE `machine_name`='favicon';");
$this->addSql("DELETE FROM `std_config` WHERE `machine_name`='logoemail';");
$this->addSql("DELETE FROM `std_config` WHERE `machine_name`='facebook_url';");
$this->addSql("DELETE FROM `std_config` WHERE `machine_name`='instagram_url';");
$this->addSql("DELETE FROM `std_config` WHERE `machine_name`='linkedin_url';");
$this->addSql("DELETE FROM `std_config` WHERE `machine_name`='youtube_url';");
$this->addSql("DELETE FROM `std_config` WHERE `machine_name`='twitter_url';");
$this->addSql("DELETE FROM `std_config` WHERE `machine_name`='footer_text';");
$this->addSql("DELETE FROM `std_config` WHERE `machine_name`='footer_text2';");
$this->addSql("DELETE FROM `std_config` WHERE `machine_name`='header_style';");
$this->addSql("DELETE FROM `std_config` WHERE `machine_name`='footer_style';");
$this->addSql("DELETE FROM `std_config` WHERE `machine_name`='breadcrumb';");
$this->addSql("DELETE FROM `std_config` WHERE `machine_name`='breadcrumb_align';");
$this->addSql("DELETE FROM `std_pages_content` WHERE `title`='Menu Footer 1';");
$this->addSql("DELETE FROM `std_pages_content` WHERE `title`='Menu Footer 2';");
$this->addSql("DELETE FROM `std_pages_content` WHERE `title`='Menu Footer 3';");
$this->addSql("DELETE FROM `std_pages_pages` WHERE `page_id`=(SELECT `id` FROM `std_pages` WHERE `name`='Menu Footer 1');");
$this->addSql("DELETE FROM `std_pages_pages` WHERE `page_id`=(SELECT `id` FROM `std_pages` WHERE `name`='Menu Footer 2');");
$this->addSql("DELETE FROM `std_pages_pages` WHERE `page_id`=(SELECT `id` FROM `std_pages` WHERE `name`='Menu Footer 3');");
$this->addSql("DELETE FROM `std_pages` WHERE `name`='Menu Footer 1';");
$this->addSql("DELETE FROM `std_pages` WHERE `name`='Menu Footer 2';");
$this->addSql("DELETE FROM `std_pages` WHERE `name`='Menu Footer 3';");
$this->addSql("DELETE FROM `std_content_types_skins` WHERE `machine_name`='menufooter';");
$this->addSql("DELETE FROM `std_config` WHERE `machine_name`='menufooter1';");
$this->addSql("DELETE FROM `std_config` WHERE `machine_name`='menufooter1_skin';");
$this->addSql("DELETE FROM `std_config` WHERE `machine_name`='menufooter2';");
$this->addSql("DELETE FROM `std_config` WHERE `machine_name`='menufooter2_skin';");
$this->addSql("DELETE FROM `std_config` WHERE `machine_name`='menufooter3';");
$this->addSql("DELETE FROM `std_config` WHERE `machine_name`='menufooter3_skin';");
}
}