<?php
declare(strict_types=1);
namespace PPSDKDoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
final class Version20220506182802_TipContestBonusTimeRange extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
$this->addSql('
ALTER TABLE tip_contests
ADD transactions_bonus_enabled TINYINT(1) DEFAULT 1 NOT NULL,
ADD transactions_bonus_active_from_when DATETIME DEFAULT NULL,
ADD transactions_bonus_active_to_when DATETIME DEFAULT NULL,
ADD points_definition_exact_score_hit_points INT DEFAULT 5 NOT NULL,
ADD points_definition_winner_or_tie_hit_points INT DEFAULT 3 NOT NULL,
ADD points_definition_team_score_hit_points INT DEFAULT 1 NOT NULL
');
$this->addSql('
UPDATE tip_contests
SET
transactions_bonus_active_from_when = active_from_when,
transactions_bonus_active_to_when = active_to_when
WHERE 1
');
$this->addSql('
ALTER TABLE tip_contests
DROP active_from_when,
DROP active_to_when
');
}
public function down(Schema $schema): void
{
$this->addSql('
ALTER TABLE tip_contests
ADD active_from_when DATETIME NOT NULL,
ADD active_to_when DATETIME NOT NULL,
DROP transactions_bonus_enabled,
DROP transactions_bonus_active_from_when,
DROP transactions_bonus_active_to_when,
DROP points_definition_exact_score_hit_points,
DROP points_definition_winner_or_tie_hit_points,
DROP points_definition_team_score_hit_points
');
}
}