| Total Complexity | 6 |
| Total Lines | 47 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 10 | class m181018_123901_add_stats_info extends Migration |
||
| 11 | { |
||
| 12 | /** |
||
| 13 | * @inheritdoc |
||
| 14 | */ |
||
| 15 | public function safeUp(): bool |
||
| 16 | { |
||
| 17 | if (!$this->db->columnExists('{{%retour_stats}}', 'exceptionFileLine')) { |
||
| 18 | $this->addColumn( |
||
| 19 | '{{%retour_stats}}', |
||
| 20 | 'exceptionFileLine', |
||
| 21 | $this->integer(45)->after('remoteIp')->defaultValue(0) |
||
| 22 | ); |
||
| 23 | } |
||
| 24 | if (!$this->db->columnExists('{{%retour_stats}}', 'exceptionFilePath')) { |
||
| 25 | $this->addColumn( |
||
| 26 | '{{%retour_stats}}', |
||
| 27 | 'exceptionFilePath', |
||
| 28 | $this->string(255)->after('remoteIp')->defaultValue('') |
||
| 29 | ); |
||
| 30 | } |
||
| 31 | if (!$this->db->columnExists('{{%retour_stats}}', 'exceptionMessage')) { |
||
| 32 | $this->addColumn( |
||
| 33 | '{{%retour_stats}}', |
||
| 34 | 'exceptionMessage', |
||
| 35 | $this->string(255)->after('remoteIp')->defaultValue('') |
||
| 36 | ); |
||
| 37 | } |
||
| 38 | if (!$this->db->columnExists('{{%retour_stats}}', 'userAgent')) { |
||
| 39 | $this->addColumn( |
||
| 40 | '{{%retour_stats}}', |
||
| 41 | 'userAgent', |
||
| 42 | $this->string(255)->after('remoteIp')->defaultValue('') |
||
| 43 | ); |
||
| 44 | } |
||
| 45 | |||
| 46 | return true; |
||
| 47 | } |
||
| 48 | |||
| 49 | /** |
||
| 50 | * @inheritdoc |
||
| 51 | */ |
||
| 52 | public function safeDown(): bool |
||
| 57 | } |
||
| 58 | } |
||
| 59 |