<?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 Version20210217142957 extends AbstractMigration
{
public function getDescription() : string
{
return '';
}
public function up(Schema $schema) : void
{
// Create block "Web User Detail"
$this->addSql("INSERT INTO `std_blocks` (`created_by`, `updated_by`, `machine_name`, `created_date`, `updated_date`, `name`, `settings`) VALUES ('1', '1', 'web_users_password', NOW(), NOW(), 'Alterar password', '{\"isWebUserPass\": true}');");
$this->addSql("SET @id_block = (SELECT id FROM `std_blocks` WHERE `machine_name` = 'web_users_password');");
$this->addSql("INSERT INTO `std_blocks_components` (`machine_name`, `block_id`, `created_by`, `updated_by`, `component_type`, `settings`, `order_value`, `is_active`, `created_date`, `updated_date`, `name`, `is_repeatable`) VALUES ('title', @id_block, 1, 1, 'INPUT', NULL, 10, 1, NOW(), NOW(), 'Título', 0);");
$this->addSql("INSERT INTO `std_notifications` (`language_code`, `name`, `machine_name`, `email_subject`, `email_body`) VALUES ('pt', 'Alteração password sucesso', 'webuserpasschanged', 'A sua password foi alterada', 'A sua password no website Studio CMS foi alterada. Clique no link abaixo para visitar o website.<br><a href=\"https://www.google.pt\">Visitar website</a>');");
}
public function down(Schema $schema) : void
{
// Delete block "Web User Detail"
$this->addSql("SET @id_block = (SELECT id FROM `std_blocks` WHERE `machine_name` = 'web_users_password');");
$this->addSql("DELETE FROM `std_blocks_components` WHERE `block_id` = @id_block;");
$this->addSql("DELETE FROM `std_blocks` WHERE `machine_name` = 'web_users_password';");
$this->addSql("DELETE FROM `std_notifications` WHERE `machine_name`='webuserpasschanged';");
}
}