Failed Conditions
Push — master ( a427b2...509ea4 )
by Adrien
16:44
created

Version20190513041833   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 1
eloc 10
dl 0
loc 15
rs 10
c 0
b 0
f 0
ccs 0
cts 10
cp 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A up() 0 13 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Application\Migration;
6
7
use Doctrine\DBAL\Schema\Schema;
8
use Doctrine\Migrations\AbstractMigration;
9
10
class Version20190513041833 extends AbstractMigration
11
{
12
    public function up(Schema $schema): void
13
    {
14
        $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
0 ignored issues
show
Deprecated Code introduced by
The function Doctrine\DBAL\Platforms\...ractPlatform::getName() has been deprecated: Identify platforms by their class. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

14
        $this->abortIf(/** @scrutinizer ignore-deprecated */ $this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');

This function has been deprecated. The supplier of the function has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the function will be removed and what other function to use instead.

Loading history...
15
16
        $this->addSql('UPDATE account SET balance = 100 * balance');
17
        $this->addSql('UPDATE transaction_line SET balance = 100 * balance');
18
        $this->addSql('UPDATE expense_claim SET amount = 100 * amount');
19
        $this->addSql('UPDATE bookable SET initial_price = 100 * initial_price, periodic_price = 100 * periodic_price, purchase_price = 100 * purchase_price;');
20
21
        $this->addSql('ALTER TABLE account CHANGE balance balance INT DEFAULT 0 NOT NULL COMMENT \'(DC2Type:Money)\'');
22
        $this->addSql('ALTER TABLE transaction_line CHANGE balance balance INT UNSIGNED NOT NULL COMMENT \'(DC2Type:Money)\'');
23
        $this->addSql('ALTER TABLE expense_claim CHANGE amount amount INT UNSIGNED NOT NULL COMMENT \'(DC2Type:Money)\'');
24
        $this->addSql('ALTER TABLE bookable CHANGE initial_price initial_price INT DEFAULT 0 NOT NULL COMMENT \'(DC2Type:Money)\', CHANGE periodic_price periodic_price INT DEFAULT 0 NOT NULL COMMENT \'(DC2Type:Money)\', CHANGE purchase_price purchase_price INT UNSIGNED DEFAULT 0 NOT NULL COMMENT \'(DC2Type:Money)\';');
25
    }
26
}
27