<?php
declare(strict_types=1);
namespace PPSDKDoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20220520140620_StatisticsUpdate 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('ALTER TABLE promotions
ADD stats_redirects_count INT NOT NULL,
ADD stats_transactions_registered INT NOT NULL,
ADD stats_transactions_commission_internal DOUBLE PRECISION NOT NULL,
DROP stats_special_offer_in_progress,
DROP stats_views_count,
DROP stats_clicks_count,
DROP stats_total_turnover,
DROP stats_total_commission,
DROP stats_total_shop_turnover,
DROP stats_total_shop_commission
');
$this->addSql('ALTER TABLE shops DROP stats_special_offer_in_progress');
$this->addSql('ALTER TABLE users_shop_activities DROP previous_favorite_date');
}
public function down(Schema $schema): void
{
$this->addSql('ALTER TABLE promotions
ADD stats_special_offer_in_progress TINYINT(1) NOT NULL,
ADD stats_views_count INT NOT NULL,
ADD stats_clicks_count INT NOT NULL,
ADD stats_total_turnover NUMERIC(10, 2) NOT NULL,
ADD stats_total_commission NUMERIC(10, 2) NOT NULL,
ADD stats_total_shop_turnover NUMERIC(10, 2) NOT NULL,
ADD stats_total_shop_commission NUMERIC(10, 2) NOT NULL,
DROP stats_redirects_count,
DROP stats_transactions_registered,
DROP stats_transactions_commission_internal
');
$this->addSql('ALTER TABLE shops ADD stats_special_offer_in_progress TINYINT(1) NOT NULL');
$this->addSql('ALTER TABLE users_shop_activities ADD previous_favorite_date DATE DEFAULT NULL');
}
}