m161004_065553_dropDefaultValuesFromSettings   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 1
eloc 14
c 0
b 0
f 0
dl 0
loc 18
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A initInverter() 0 15 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