add devlog table
This commit is contained in:
parent
167a303296
commit
13443886c1
39
console/migrations/m160324_203543_devlog.php
Normal file
39
console/migrations/m160324_203543_devlog.php
Normal file
@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
use yii\db\Schema;
|
||||
use yii\db\Migration;
|
||||
|
||||
class m160324_203543_devlog extends Migration
|
||||
{
|
||||
public function up()
|
||||
{
|
||||
$tableOptions = null;
|
||||
if ($this->db->driverName === 'mysql') {
|
||||
// http://stackoverflow.com/questions/766809/whats-the-difference-between-utf8-general-ci-and-utf8-unicode-ci
|
||||
$tableOptions = 'CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE=InnoDB';
|
||||
}
|
||||
|
||||
$this->createTable( '{{%devlog}}', [
|
||||
'id_devlog' => $this->primaryKey(),
|
||||
'msg' => $this->string(),
|
||||
], $tableOptions );
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
echo "m160324_203543_devlog cannot be reverted.\n";
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
// Use safeUp/safeDown to run migration code within a transaction
|
||||
public function safeUp()
|
||||
{
|
||||
}
|
||||
|
||||
public function safeDown()
|
||||
{
|
||||
}
|
||||
*/
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user