mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-09 17:57:38 +08:00
Merge branch 'master' of https://github.com/yiisoft/yii2 into sphinx
This commit is contained in:
@ -6,19 +6,21 @@ class m130524_201442_init extends \yii\db\Migration
|
|||||||
{
|
{
|
||||||
public function up()
|
public function up()
|
||||||
{
|
{
|
||||||
// MySQL-specific table options. Adjust if you plan working with another DBMS
|
$tableOptions = null;
|
||||||
$tableOptions = 'CHARACTER SET utf8 COLLATE utf8_general_ci ENGINE=InnoDB';
|
if ($this->db->driverName === 'mysql') {
|
||||||
|
$tableOptions = 'CHARACTER SET utf8 COLLATE utf8_general_ci ENGINE=InnoDB';
|
||||||
|
}
|
||||||
|
|
||||||
$this->createTable('tbl_user', [
|
$this->createTable('tbl_user', [
|
||||||
'id' => Schema::TYPE_PK,
|
'id' => Schema::TYPE_PK,
|
||||||
'username' => Schema::TYPE_STRING.' NOT NULL',
|
'username' => Schema::TYPE_STRING . ' NOT NULL',
|
||||||
'auth_key' => Schema::TYPE_STRING.'(32) NOT NULL',
|
'auth_key' => Schema::TYPE_STRING . '(32) NOT NULL',
|
||||||
'password_hash' => Schema::TYPE_STRING.' NOT NULL',
|
'password_hash' => Schema::TYPE_STRING . ' NOT NULL',
|
||||||
'password_reset_token' => Schema::TYPE_STRING.'(32)',
|
'password_reset_token' => Schema::TYPE_STRING . '(32)',
|
||||||
'email' => Schema::TYPE_STRING.' NOT NULL',
|
'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',
|
'create_time' => Schema::TYPE_INTEGER.' NOT NULL',
|
||||||
'update_time' => Schema::TYPE_INTEGER.' NOT NULL',
|
'update_time' => Schema::TYPE_INTEGER.' NOT NULL',
|
||||||
], $tableOptions);
|
], $tableOptions);
|
||||||
|
|||||||
Reference in New Issue
Block a user