2019-11-16 20:37:33 +01:00
|
|
|
<?php
|
|
|
|
|
2019-11-30 18:19:13 +01:00
|
|
|
use App\Enums\UserRole;
|
2019-11-16 20:37:33 +01:00
|
|
|
use Illuminate\Support\Facades\Schema;
|
2019-11-30 18:19:13 +01:00
|
|
|
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');
|
2019-11-30 18:19:13 +01:00
|
|
|
$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');
|
|
|
|
}
|
|
|
|
}
|