Skip to content

Instantly share code, notes, and snippets.

@virbo
Created July 25, 2017 03:42
Show Gist options
  • Save virbo/3a3d9a46bd539f904046e0ba28fef66b to your computer and use it in GitHub Desktop.
Save virbo/3a3d9a46bd539f904046e0ba28fef66b to your computer and use it in GitHub Desktop.
<?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