2014-12-20 16:56:46 +10:30
|
|
|
<?php
|
|
|
|
|
2015-08-12 01:29:40 +02:00
|
|
|
use Flarum\Install\Migration;
|
2014-12-20 16:56:46 +10:30
|
|
|
use Illuminate\Database\Schema\Blueprint;
|
2015-06-09 02:45:02 +02:00
|
|
|
use Illuminate\Support\Facades\Schema;
|
2014-12-20 16:56:46 +10:30
|
|
|
|
2015-05-19 01:22:09 +02:00
|
|
|
class CreateUsersTable extends Migration
|
|
|
|
{
|
2014-12-20 16:56:46 +10:30
|
|
|
|
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
|
|
|
}
|