Browse Source

Adjusted advanced app migration so it is now OK for non-mysql

tags/2.0.0-beta
Alexander Makarov 11 years ago
parent
commit
7fa3b699c1
  1. 8
      apps/advanced/console/migrations/m130524_201442_init.php

8
apps/advanced/console/migrations/m130524_201442_init.php

@ -6,8 +6,10 @@ class m130524_201442_init extends \yii\db\Migration
{
public function up()
{
// MySQL-specific table options. Adjust if you plan working with another DBMS
$tableOptions = null;
if ($this->db->driverName === 'mysql') {
$tableOptions = 'CHARACTER SET utf8 COLLATE utf8_general_ci ENGINE=InnoDB';
}
$this->createTable('tbl_user', [
'id' => Schema::TYPE_PK,
@ -16,9 +18,9 @@ class m130524_201442_init extends \yii\db\Migration
'password_hash' => Schema::TYPE_STRING . ' NOT NULL',
'password_reset_token' => Schema::TYPE_STRING . '(32)',
'email' => Schema::TYPE_STRING . ' NOT NULL',
'role' => 'tinyint NOT NULL DEFAULT 10',
'role' => Schema::TYPE_SMALLINT . ' NOT NULL DEFAULT 10',
'status' => 'tinyint NOT NULL DEFAULT 10',
'status' => Schema::TYPE_SMALLINT . ' NOT NULL DEFAULT 10',
'create_time' => Schema::TYPE_INTEGER.' NOT NULL',
'update_time' => Schema::TYPE_INTEGER.' NOT NULL',
], $tableOptions);

Loading…
Cancel
Save