Version20180611205001::up()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 7
nc 1
nop 1
dl 0
loc 11
rs 10
c 0
b 0
f 0
1
<?php declare(strict_types=1);
2
3
namespace DoctrineMigrations;
4
5
use Doctrine\DBAL\Schema\Schema;
6
use Doctrine\Migrations\AbstractMigration;
7
8
/**
9
 * Auto-generated Migration: Please modify to your needs!
10
 */
11
final class Version20180611205001 extends AbstractMigration
12
{
13
    public function up(Schema $schema) : void
14
    {
15
        // this up() migration is auto-generated, please modify it to your needs
16
        $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
17
18
        $this->addSql('ALTER TABLE user_betting DROP INDEX UNIQ_6D031E8E48FD905, ADD INDEX IDX_6D031E8E48FD905 (game_id)');
19
        $this->addSql('ALTER TABLE user_betting DROP INDEX UNIQ_6D031E8A76ED395, ADD INDEX IDX_6D031E8A76ED395 (user_id)');
20
        $this->addSql('ALTER TABLE user_betting CHANGE game_id game_id INT DEFAULT NULL, CHANGE user_id user_id INT DEFAULT NULL');
21
        $this->addSql('ALTER TABLE game DROP INDEX UNIQ_232B318C500FBE21, ADD INDEX IDX_232B318C500FBE21 (team_first_id)');
22
        $this->addSql('ALTER TABLE game DROP INDEX UNIQ_232B318C4893052B, ADD INDEX IDX_232B318C4893052B (team_second_id)');
23
        $this->addSql('ALTER TABLE game CHANGE team_first_id team_first_id INT DEFAULT NULL, CHANGE team_second_id team_second_id INT DEFAULT NULL');
24
    }
25
26
    public function down(Schema $schema) : void
27
    {
28
        // this down() migration is auto-generated, please modify it to your needs
29
        $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
30
31
        $this->addSql('ALTER TABLE game DROP INDEX IDX_232B318C500FBE21, ADD UNIQUE INDEX UNIQ_232B318C500FBE21 (team_first_id)');
32
        $this->addSql('ALTER TABLE game DROP INDEX IDX_232B318C4893052B, ADD UNIQUE INDEX UNIQ_232B318C4893052B (team_second_id)');
33
        $this->addSql('ALTER TABLE game CHANGE team_first_id team_first_id INT NOT NULL, CHANGE team_second_id team_second_id INT NOT NULL');
34
        $this->addSql('ALTER TABLE user_betting DROP INDEX IDX_6D031E8E48FD905, ADD UNIQUE INDEX UNIQ_6D031E8E48FD905 (game_id)');
35
        $this->addSql('ALTER TABLE user_betting DROP INDEX IDX_6D031E8A76ED395, ADD UNIQUE INDEX UNIQ_6D031E8A76ED395 (user_id)');
36
        $this->addSql('ALTER TABLE user_betting CHANGE game_id game_id INT NOT NULL, CHANGE user_id user_id INT NOT NULL');
37
    }
38
}
39