Created
December 8, 2017 14:18
-
-
Save hanspagel/bcb983801518f4a30989f7111f978870 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use Illuminate\Database\Migrations\Migration; | |
use Illuminate\Database\Schema\Blueprint; | |
use Illuminate\Support\Facades\DB; | |
use Illuminate\Support\Facades\Schema; | |
class CreateUsersTable extends Migration | |
{ | |
public function up() | |
{ | |
DB::statement('CREATE EXTENSION IF NOT EXISTS "uuid-ossp";'); | |
Schema::create('users', function (Blueprint $table) { | |
$table->uuid('id')->primary()->default(DB::raw('uuid_generate_v4()')); | |
$table->string('name'); | |
$table->string('email')->unique(); | |
$table->string('password'); | |
$table->rememberToken(); | |
$table->timestamps(); | |
}); | |
} | |
public function down() | |
{ | |
Schema::dropIfExists('users'); | |
DB::statement('DROP EXTENSION IF EXISTS "uuid-ossp";'); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment