for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace nystudio107\retour\migrations;
use craft\db\Migration;
/**
* m181018_123901_add_stats_info migration.
*/
class m181018_123901_add_stats_info extends Migration
{
* @inheritdoc
public function safeUp(): bool
if (!$this->db->columnExists('{{%retour_stats}}', 'exceptionFileLine')) {
$this->addColumn(
'{{%retour_stats}}',
'exceptionFileLine',
$this->integer(45)->after('remoteIp')->defaultValue(0)
);
}
if (!$this->db->columnExists('{{%retour_stats}}', 'exceptionFilePath')) {
'exceptionFilePath',
$this->string(255)->after('remoteIp')->defaultValue('')
if (!$this->db->columnExists('{{%retour_stats}}', 'exceptionMessage')) {
'exceptionMessage',
if (!$this->db->columnExists('{{%retour_stats}}', 'userAgent')) {
'userAgent',
return true;
public function safeDown(): bool
echo "m181018_123901_add_stats_info cannot be reverted.\n";
return false;