migrations/Version20240806123924.php line 1

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace DoctrineMigrations;
  4. use Doctrine\DBAL\Schema\Schema;
  5. use Doctrine\Migrations\AbstractMigration;
  6. /**
  7.  * Auto-generated Migration: Please modify to your needs!
  8.  */
  9. final class Version20240806123924 extends AbstractMigration
  10. {
  11.     public function getDescription(): string
  12.     {
  13.         return '';
  14.     }
  15.     public function up(Schema $schema): void
  16.     {
  17.         // this up() migration is auto-generated, please modify it to your needs
  18.         $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');
  19.         $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');
  20.         $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');
  21.     }
  22.     public function down(Schema $schema): void
  23.     {
  24.         // this down() migration is auto-generated, please modify it to your needs
  25.         $this->addSql('DROP TABLE log_statistic_daily');
  26.         $this->addSql('DROP TABLE log_statistic_monthly');
  27.         $this->addSql('DROP TABLE log_statistic_yearly');
  28.     }
  29. }