<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
final class Version20240805153122 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
$this->addSql('CREATE TABLE std_seo_benchmark (id INT AUTO_INCREMENT NOT NULL, updated_date DATETIME NOT NULL, meta_percentage float NOT NULL, og_percentage float NOT NULL, block_percentage float NOT NULL, missing_content LONGTEXT DEFAULT NULL, checked_pages LONGTEXT DEFAULT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('INSERT INTO std_seo_benchmark (id,updated_date,meta_percentage,og_percentage,block_percentage,checked_pages) VALUES (1,(SELECT CURDATE()),0,0,0,"{\"numberPages\":0,\"numberPagesMissingContent\":0}")');
$this->addSql('INSERT INTO std_scheduler_commands (machine_name,name,is_active,is_stoppable) VALUES ("studio:sync-seo-benchmarks","Sync SEO Benchmarks",1,0)');
$this->addSql('INSERT INTO std_scheduler_tasks (created_by,updated_by,scheduler_command_id,name,description,cron_expression,execute_at,is_active,created_date,updated_date) VALUES (1,1,(SELECT `id` from `std_scheduler_commands` where `machine_name`="studio:sync-seo-benchmarks"),"Update SEO Benchmarks","Update SEO Benchmarks","0 0 * * *",(SELECT CURDATE()),1,(SELECT CURDATE()),(SELECT CURDATE()))');
}
public function down(Schema $schema): void
{
$this->addSql('DROP TABLE std_seo_benchmark');
$this->addSql("DELETE FROM `std_scheduler_tasks` WHERE `scheduler_command_id` = (SELECT `id` FROM `std_scheduler_commands` WHERE `machine_name` = 'studio:sync-seo-benchmarks');");
$this->addSql("DELETE FROM `std_scheduler_commands` WHERE `machine_name` = 'studio:sync-seo-benchmarks';");
}
}