source: database/migrations/2019_10_12_000000_create_users_table.php@ 0c07a90

Last change on this file since 0c07a90 was 0924b6c, checked in by Özkan İliyaz <iliyaz_96@…>, 4 years ago

initial commit

  • Property mode set to 100644
File size: 1.4 KB
Line 
1<?php
2
3use Illuminate\Support\Str;
4use Illuminate\Support\Facades\Schema;
5use Illuminate\Database\Schema\Blueprint;
6use Illuminate\Database\Migrations\Migration;
7
8class CreateUsersTable extends Migration
9{
10 /**
11 * Run the migrations.
12 *
13 * @return void
14 */
15 public function up()
16 {
17 Schema::create('users', function (Blueprint $table) {
18 $table->increments('id');
19 $table->string('name');
20 $table->string('surname');
21 $table->string('username')->unique();
22 $table->string('password');
23 $table->string('email')->unique();
24 $table->string('country_code');
25 $table->string('mobile_number')->unique();
26 $table->integer('role_id')->unsigned();
27 $table->foreign("role_id")->references("id")->on("roles");
28 $table->boolean('is_active')->default(false);
29 $table->boolean('is_online')->default(false);
30 $table->boolean('is_confirmed')->default(false);
31 $table->boolean('is_forgot_password')->default(false);
32 $table->integer('security_code')->nullable();
33 $table->string('verify_token')->nullable();
34 $table->rememberToken();
35 $table->timestamps();
36 });
37 }
38
39 /**
40 * Reverse the migrations.
41 *
42 * @return void
43 */
44 public function down()
45 {
46 Schema::dropIfExists('users');
47 }
48}
Note: See TracBrowser for help on using the repository browser.