Skip to content

Commit

Permalink
bug fix migration
Browse files Browse the repository at this point in the history
  • Loading branch information
hscstudio committed Jan 29, 2016
1 parent 5d73210 commit af004f7
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions migrations/m151024_072453_create_route_table.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,26 @@ class m151024_072453_create_route_table extends Migration
{
public function up()
{
$tableOptions = null;
$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('{{%route}}', [
'name' => $this->string(64)->primaryKey(),
$this->createTable('{{%route}}', [
'name' => $this->string(64),
'alias' => $this->string(64)->notNull(),
'type' => $this->string(64)->notNull(),
'status' => $this->smallInteger()->notNull()->defaultValue(1),
'PRIMARY KEY(name)',
], $tableOptions);
}

public function down()
{
echo "m151024_072453_create_route_table cannot be reverted.\n";

$this->dropTable('{{%route}}');
$this->dropTable('{{%route}}');
return false;
}

Expand Down

0 comments on commit af004f7

Please sign in to comment.