Browse Source

MySQL migration for User model

tags/2.0.0-beta
Alexander Makarov 12 years ago
parent
commit
c4380f65a5
  1. 1
      apps/advanced/console/migrations/.gitkeep
  2. 27
      apps/advanced/console/migrations/m130524_201442_init.php

1
apps/advanced/console/migrations/.gitkeep

@ -1 +0,0 @@
*

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

@ -0,0 +1,27 @@
<?php
class m130524_201442_init extends \yii\db\Migration
{
public function up()
{
// MySQL-specific table options. Adjust if you plan working with another DBMS
$tableOptions = 'CHARACTER SET utf8 COLLATE utf8_general_ci ENGINE=InnoDB';
$this->createTable('tbl_user', array(
'id' => Schema::TYPE_PK,
'username' => Schema::TYPE_STRING.' NOT NULL',
'password_hash' => Schema::TYPE_STRING.' NOT NULL',
'email' => Schema::TYPE_STRING.' NOT NULL',
'role' => 'tinyint NOT NULL DEFAULT 10',
'status' => 'tinyint NOT NULL DEFAULT 10',
'create_time' => Schema::TYPE_INTEGER.' NOT NULL',
'update_time' => Schema::TYPE_INTEGER.' NOT NULL',
), $tableOptions);
}
public function down()
{
$this->dropTable('tbl_user');
}
}
Loading…
Cancel
Save