Skip to content

Commit

Permalink
log migration fix
Browse files Browse the repository at this point in the history
  • Loading branch information
trntv committed Feb 5, 2015
1 parent 844d906 commit 83b3b60
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 31 deletions.
29 changes: 2 additions & 27 deletions common/migrations/m140703_123055_log.php
@@ -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}}');
}
}
5 changes: 1 addition & 4 deletions common/migrations/m140703_123813_rbac.php
@@ -1,9 +1,6 @@
<?php

use yii\db\Schema;
use yii\db\Migration;

require(Yii::getAlias('@yii/rbac/migrations/m140506_102106_rbac_init.php'));

class m140703_123813_rbac extends m140506_102106_rbac_init
{

Expand Down

0 comments on commit 83b3b60

Please sign in to comment.