Test Failed
Branch master (354693)
by Valery
09:47
created

Version20191010104603::up()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 4
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 8
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace DoctrineMigrations;
6
7
use Doctrine\DBAL\Schema\Schema;
8
use Doctrine\Migrations\AbstractMigration;
9
10
/**
11
 * Auto-generated Migration: Please modify to your needs!
12
 */
13
final class Version20191010104603 extends AbstractMigration
14
{
15
    public function getDescription() : string
16
    {
17
        return '';
18
    }
19
20
    public function up(Schema $schema) : void
21
    {
22
        // this up() migration is auto-generated, please modify it to your needs
23
        $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
24
25
        $this->addSql('CREATE TABLE currency (id INT AUTO_INCREMENT NOT NULL, currency_title VARCHAR(32) NOT NULL, code VARCHAR(3) NOT NULL, symbol_left VARCHAR(12) DEFAULT NULL, symbol_right VARCHAR(12) DEFAULT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB');
26
        $this->addSql('ALTER TABLE setting CHANGE map_zoom map_zoom INT DEFAULT NULL');
27
        $this->addSql("INSERT INTO `currency` (`id`, `currency_title`, `code`, `symbol_left`, `symbol_right`) VALUES (NULL, 'US Dollar', 'USD', '$', NULL)");
28
    }
29
30
    public function down(Schema $schema) : void
31
    {
32
        // this down() migration is auto-generated, please modify it to your needs
33
        $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
34
35
        $this->addSql('DROP TABLE currency');
36
        $this->addSql('ALTER TABLE setting CHANGE map_zoom map_zoom INT DEFAULT 7');
37
    }
38
}
39