Created
July 25, 2017 03:42
-
-
Save virbo/3a3d9a46bd539f904046e0ba28fef66b to your computer and use it in GitHub Desktop.
This file contains hidden or 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
<?php | |
use yii\db\Schema; | |
class m160804_160101_history extends \yii\db\Migration | |
{ | |
public function up() | |
{ | |
$tableOptions = null; | |
if ($this->db->driverName === 'mysql') { | |
$tableOptions = 'CHARACTER SET utf8 COLLATE utf8_general_ci ENGINE=InnoDB'; | |
} | |
$this->createTable('history', [ | |
'id' => Schema::TYPE_PK, | |
'users' => Schema::TYPE_STRING . '(10) NOT NULL', | |
'message' => Schema::TYPE_TEXT . ' NOT NULL', | |
'tanggal' => Schema::TYPE_TIMESTAMP, | |
], $tableOptions); | |
} | |
public function down() | |
{ | |
$this->dropTable('history'); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment