Edit File: 2021_06_25_200904_create_users_table.php
<?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; class CreateUsersTable extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::create('users', function (Blueprint $table) { $table->id(); $table->string('name')->nullable(); $table->string('email')->nullable(); $table->string('country_key')->nullable(); $table->string('phone')->nullable(); $table->string('changed_phone')->nullable(); $table->string('password')->nullable(); $table->timestamp('email_verified_at')->nullable(); $table->timestamp('phone_verified_at')->nullable(); $table->string('avatar')->default('default.png'); $table->enum('status', [ "block" , "pending", "active" ])->default('pending'); $table->enum('approve', ["pending", "accept" , 'refused' ])->default('pending'); $table->boolean('active')->default(true); $table->boolean('block')->default(false); $table->enum('gender', ['male', 'female'])->nullable(); $table->enum('completed_info', ['true', 'false'])->default('true'); $table->enum('type', ['user','delegate','company','store'])->default('user'); $table->string('code')->nullable(); $table->foreignId('nationality_id')->nullable()->constrained()->references('id')->on('nationalities')->onDelete('set Null'); $table->string('bank_iban_number')->nullable(); $table->string('pin_code')->nullable(); $table->string('lat')->nullable(); $table->string('long')->nullable(); $table->text('address')->nullable(); $table->double('points')->default(0)->nullable(); $table->double('wallet')->default(0)->nullable(); $table->double('total_bills')->default(0)->nullable(); $table->double('total_delivery_fees')->default(0)->nullable(); $table->double('num_orders')->default(0)->nullable(); $table->double('num_comments')->default(0)->nullable(); $table->integer('num_rating')->default(0); $table->string('rate')->default('0.00'); $table->foreignId('company_id')->nullable()->constrained()->references('id')->on('users')->onDelete('set null'); $table->foreignId('city_id')->nullable()->constrained()->references('id')->on('cities')->onDelete('set null'); $table->string('lang')->default('ar')->nullable(); $table->enum('offers_notify',['true','false'])->nullable()->default('true'); $table->enum('new_orders_notify',['true','false'])->nullable()->default('true'); $table->softDeletes(); $table->rememberToken(); $table->timestamps(); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::dropIfExists('users'); } }
Back to File Manager