vendor/plna-penezenka/pp-sdk-bundle/migrations/Version20220520140620_StatisticsUpdate.php line 1

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace PPSDKDoctrineMigrations;
  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 Version20220520140620_StatisticsUpdate 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('ALTER TABLE promotions 
  19.             ADD stats_redirects_count INT NOT NULL, 
  20.             ADD stats_transactions_registered INT NOT NULL, 
  21.             ADD stats_transactions_commission_internal DOUBLE PRECISION NOT NULL, 
  22.             DROP stats_special_offer_in_progress, 
  23.             DROP stats_views_count, 
  24.             DROP stats_clicks_count, 
  25.             DROP stats_total_turnover, 
  26.             DROP stats_total_commission,
  27.             DROP stats_total_shop_turnover,
  28.             DROP stats_total_shop_commission
  29.         ');
  30.         $this->addSql('ALTER TABLE shops DROP stats_special_offer_in_progress');
  31.         $this->addSql('ALTER TABLE users_shop_activities DROP previous_favorite_date');
  32.     }
  33.     public function down(Schema $schema): void
  34.     {
  35.         $this->addSql('ALTER TABLE promotions 
  36.             ADD stats_special_offer_in_progress TINYINT(1) NOT NULL, 
  37.             ADD stats_views_count INT NOT NULL, 
  38.             ADD stats_clicks_count INT NOT NULL, 
  39.             ADD stats_total_turnover NUMERIC(10, 2) NOT NULL,
  40.             ADD stats_total_commission NUMERIC(10, 2) NOT NULL,
  41.             ADD stats_total_shop_turnover NUMERIC(10, 2) NOT NULL,
  42.             ADD stats_total_shop_commission NUMERIC(10, 2) NOT NULL, 
  43.             DROP stats_redirects_count, 
  44.             DROP stats_transactions_registered, 
  45.             DROP stats_transactions_commission_internal
  46.         ');
  47.         $this->addSql('ALTER TABLE shops ADD stats_special_offer_in_progress TINYINT(1) NOT NULL');
  48.         $this->addSql('ALTER TABLE users_shop_activities ADD previous_favorite_date DATE DEFAULT NULL');
  49.     }
  50. }