2014-12-20 16:56:46 +10:30
|
|
|
<?php
|
|
|
|
|
2015-08-26 16:18:58 +09:30
|
|
|
/*
|
|
|
|
* This file is part of Flarum.
|
|
|
|
*
|
|
|
|
* (c) Toby Zerner <toby.zerner@gmail.com>
|
|
|
|
*
|
|
|
|
* For the full copyright and license information, please view the LICENSE
|
|
|
|
* file that was distributed with this source code.
|
|
|
|
*/
|
|
|
|
|
2015-08-14 12:47:59 +09:30
|
|
|
use Flarum\Migrations\Migration;
|
2014-12-20 16:56:46 +10:30
|
|
|
use Illuminate\Database\Schema\Blueprint;
|
|
|
|
|
2015-05-19 01:22:09 +02:00
|
|
|
class CreateUsersTable extends Migration
|
|
|
|
{
|
2015-02-16 14:52:53 +10:30
|
|
|
/**
|
|
|
|
* Run the migrations.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function up()
|
|
|
|
{
|
2015-08-12 01:29:40 +02:00
|
|
|
$this->schema->create('users', function (Blueprint $table) {
|
2015-02-16 14:52:53 +10:30
|
|
|
$table->increments('id');
|
2015-05-19 00:20:36 +02:00
|
|
|
$table->string('username', 100)->unique();
|
|
|
|
$table->string('email', 150)->unique();
|
2015-02-24 20:33:18 +10:30
|
|
|
$table->boolean('is_activated')->default(0);
|
2015-05-19 00:20:36 +02:00
|
|
|
$table->string('password', 100);
|
2015-03-12 10:38:18 +10:30
|
|
|
$table->text('bio')->nullable();
|
2015-05-19 00:20:36 +02:00
|
|
|
$table->string('avatar_path', 100)->nullable();
|
2015-03-28 11:50:02 +10:30
|
|
|
$table->binary('preferences')->nullable();
|
2015-02-16 14:52:53 +10:30
|
|
|
$table->dateTime('join_time')->nullable();
|
|
|
|
$table->dateTime('last_seen_time')->nullable();
|
|
|
|
$table->dateTime('read_time')->nullable();
|
2015-03-24 15:07:38 +10:30
|
|
|
$table->dateTime('notification_read_time')->nullable();
|
2015-02-16 14:52:53 +10:30
|
|
|
$table->integer('discussions_count')->unsigned()->default(0);
|
2015-03-12 10:34:59 +10:30
|
|
|
$table->integer('comments_count')->unsigned()->default(0);
|
2015-02-16 14:52:53 +10:30
|
|
|
});
|
|
|
|
}
|
2014-12-20 16:56:46 +10:30
|
|
|
|
2015-02-16 14:52:53 +10:30
|
|
|
/**
|
|
|
|
* Reverse the migrations.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function down()
|
|
|
|
{
|
2015-08-12 01:29:40 +02:00
|
|
|
$this->schema->drop('users');
|
2015-02-16 14:52:53 +10:30
|
|
|
}
|
2014-12-20 16:56:46 +10:30
|
|
|
}
|