<?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 Version20240806123924 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('CREATE TABLE log_statistic_daily (id INT AUTO_INCREMENT NOT NULL, uuid CHAR(36) NOT NULL COMMENT \'(DC2Type:uuid)\', date DATE NOT NULL, total_read INT NOT NULL, total_read_list INT NOT NULL, total_click INT NOT NULL, entity VARCHAR(255) NOT NULL, entity_id INT DEFAULT NULL, name VARCHAR(255) DEFAULT NULL, data JSON DEFAULT NULL, is_entity_pro TINYINT(1) DEFAULT NULL, UNIQUE INDEX UNIQ_1EC3918ED17F50A6 (uuid), INDEX idx_daily_date (date), INDEX idx_daily_entity (entity, entity_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE log_statistic_monthly (id INT AUTO_INCREMENT NOT NULL, uuid CHAR(36) NOT NULL COMMENT \'(DC2Type:uuid)\', year INT NOT NULL, month INT NOT NULL, total_read INT NOT NULL, total_read_list INT NOT NULL, total_click INT NOT NULL, average_read DOUBLE PRECISION NOT NULL, average_read_list DOUBLE PRECISION NOT NULL, average_click DOUBLE PRECISION NOT NULL, entity VARCHAR(255) NOT NULL, entity_id INT DEFAULT NULL, name VARCHAR(255) DEFAULT NULL, data JSON DEFAULT NULL, is_entity_pro TINYINT(1) DEFAULT NULL, UNIQUE INDEX UNIQ_16BBB99CD17F50A6 (uuid), INDEX idx_monthly_year_month (year, month), INDEX idx_monthly_entity (entity, entity_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE log_statistic_yearly (id INT AUTO_INCREMENT NOT NULL, uuid CHAR(36) NOT NULL COMMENT \'(DC2Type:uuid)\', year INT NOT NULL, total_read INT NOT NULL, total_read_list INT NOT NULL, total_click INT NOT NULL, average_read DOUBLE PRECISION NOT NULL, average_read_list DOUBLE PRECISION NOT NULL, average_click DOUBLE PRECISION NOT NULL, entity VARCHAR(255) NOT NULL, entity_id INT DEFAULT NULL, name VARCHAR(255) DEFAULT NULL, data JSON DEFAULT NULL, is_entity_pro TINYINT(1) DEFAULT NULL, UNIQUE INDEX UNIQ_5FB4BCA7D17F50A6 (uuid), INDEX idx_yearly_year (year), INDEX idx_yearly_entity (entity, entity_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('DROP TABLE log_statistic_daily');
$this->addSql('DROP TABLE log_statistic_monthly');
$this->addSql('DROP TABLE log_statistic_yearly');
}
}