ClearBowl/database/migrations/2019_11_30_153826_create_users_table.php

36 lines
762 B
PHP
Raw Normal View History

2019-11-16 20:37:33 +01:00
<?php
use App\Enums\UserRole;
2019-11-16 20:37:33 +01:00
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
2019-11-16 20:37:33 +01:00
class CreateUsersTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('users', function (Blueprint $table) {
$table->bigIncrements('id');
$table->string('email')->unique();
$table->string('password');
$table->integer('role')->default(UserRole::USER);
2019-11-16 20:37:33 +01:00
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('users');
}
}