Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
trntv
committed
Feb 5, 2015
1 parent
844d906
commit 83b3b60
Showing
2 changed files
with
3 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,7 @@ | ||
<?php | ||
require(Yii::getAlias('@yii/log/migrations/m141106_185632_log_init.php')); | ||
|
||
use yii\db\Schema; | ||
use yii\db\Migration; | ||
|
||
class m140703_123055_log extends Migration | ||
class m140703_123055_log extends m141106_185632_log_init | ||
{ | ||
public function up() | ||
{ | ||
$tableOptions = null; | ||
if ($this->db->driverName === 'mysql') { | ||
$tableOptions = 'CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE=InnoDB'; | ||
} | ||
|
||
$this->createTable('{{%system_log}}', [ | ||
'id' => Schema::TYPE_PK, | ||
'level' => Schema::TYPE_INTEGER, | ||
'category' => Schema::TYPE_STRING . '(255)', | ||
'log_time' => Schema::TYPE_INTEGER . ' NOT NULL', | ||
'prefix' => Schema::TYPE_TEXT, | ||
'message' => Schema::TYPE_TEXT | ||
], $tableOptions); | ||
|
||
$this->createIndex('idx_log_level', '{{%system_log}}', 'level'); | ||
$this->createIndex('idx_log_category', '{{%system_log}}', 'category'); | ||
} | ||
|
||
public function down() | ||
{ | ||
$this->dropTable('{{%system_log}}'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters