37 lines
1.3 KiB
PHP
Executable File
37 lines
1.3 KiB
PHP
Executable File
<?php
|
|
|
|
use Illuminate\Database\Capsule\Manager as Capsule;
|
|
use Illuminate\Database\Schema\Blueprint;
|
|
|
|
class CreateUsersTable
|
|
{
|
|
public function up()
|
|
{
|
|
if (!Capsule::schema()->hasTable('users')) {
|
|
Capsule::schema()->create('users', function (Blueprint $table) {
|
|
$table->increments('users_id');
|
|
$table->string('users_name');
|
|
$table->string('users_email')->unique();
|
|
$table->string('users_password');
|
|
$table->string('users_role')->default('user'); // super_admin, admin, member, user
|
|
$table->integer('users_bus_id')->default(0)->index();
|
|
$table->string('users_avatar')->nullable();
|
|
$table->text('users_bio')->nullable();
|
|
$table->string('users_phone')->nullable();
|
|
$table->timestamp('users_email_verified_at')->nullable();
|
|
$table->timestamp('users_last_login_at')->nullable();
|
|
$table->string('users_status')->default('active'); // active, inactive, banned
|
|
$table->json('users_preferences')->nullable();
|
|
$table->rememberToken();
|
|
$table->timestamps();
|
|
$table->softDeletes();
|
|
});
|
|
}
|
|
}
|
|
|
|
public function down()
|
|
{
|
|
Capsule::schema()->dropIfExists('users');
|
|
}
|
|
}
|