initInverter()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 15
Code Lines 13

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 13
c 0
b 0
f 0
dl 0
loc 15
rs 9.8333
cc 1
nc 1
nop 1
1
<?php
2
namespace execut\import\migrations;
3
class m161004_065553_dropDefaultValuesFromSettings extends \execut\yii\migration\Migration
4
{
5
    // Use safeUp/safeDown to run migration code within a transaction
6
    public function initInverter(\execut\yii\migration\Inverter $i)
7
    {
8
        $i->table('import_settings')
9
            ->alterColumnDropDefault('ftp_port', 21)
10
            ->alterColumnDropNotNull('ftp_port')
11
            ->update(['ftp_port' => 21], 'ftp_port is null')
12
            ->alterColumnDropDefault('ftp_timeout', 60)
13
            ->alterColumnDropNotNull('ftp_timeout')
14
            ->update(['ftp_timeout' => 60], 'ftp_timeout is null')
15
            ->alterColumnDropDefault('site_auth_url', '\'/\'')
16
            ->alterColumnDropNotNull('site_auth_url')
17
            ->update(['site_auth_url' => ''], 'site_auth_url is null')
18
            ->alterColumnDropDefault('site_auth_method', '\'post\'')
19
            ->alterColumnDropNotNull('site_auth_method')
20
            ->update(['site_auth_method' => ''], 'site_auth_method is null')
21
        ;
22
    }
23
}
24