[0924b6c] | 1 | <?php
|
---|
| 2 |
|
---|
| 3 | use Illuminate\Support\Str;
|
---|
| 4 | use Illuminate\Support\Facades\Schema;
|
---|
| 5 | use Illuminate\Database\Schema\Blueprint;
|
---|
| 6 | use Illuminate\Database\Migrations\Migration;
|
---|
| 7 |
|
---|
| 8 | class 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();
|
---|
[f457265] | 26 | $table->integer('company_id')->unsigned()->nullable();
|
---|
[ff9da8b] | 27 | $table->foreign("company_id")->references("id")->on("companies")->onDelete("cascade");
|
---|
[0924b6c] | 28 | $table->integer('role_id')->unsigned();
|
---|
| 29 | $table->foreign("role_id")->references("id")->on("roles");
|
---|
| 30 | $table->boolean('is_active')->default(false);
|
---|
| 31 | $table->boolean('is_online')->default(false);
|
---|
| 32 | $table->boolean('is_confirmed')->default(false);
|
---|
| 33 | $table->boolean('is_forgot_password')->default(false);
|
---|
| 34 | $table->integer('security_code')->nullable();
|
---|
| 35 | $table->string('verify_token')->nullable();
|
---|
| 36 | $table->rememberToken();
|
---|
| 37 | $table->timestamps();
|
---|
| 38 | });
|
---|
| 39 | }
|
---|
| 40 |
|
---|
| 41 | /**
|
---|
| 42 | * Reverse the migrations.
|
---|
| 43 | *
|
---|
| 44 | * @return void
|
---|
| 45 | */
|
---|
| 46 | public function down()
|
---|
| 47 | {
|
---|
| 48 | Schema::dropIfExists('users');
|
---|
| 49 | }
|
---|
| 50 | }
|
---|