Edit File: 2021_10_25_152104_create_orders_table.php
<?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; class CreateOrdersTable extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::create('orders', function (Blueprint $table) { $table->id(); $table->enum('citc_accept_order',['true','false'])->default('false'); $table->string('citc_referenceCode')->nullable(); $table->foreignId('user_id')->nullable()->constrained()->onDelete('set null'); $table->foreignId('delegate_id')->nullable()->constrained()->references('id')->on('users')->onDelete('set null'); $table->foreignId('store_id')->nullable()->constrained()->onDelete('set null'); $table->string('store_name')->nullable(); $table->string('store_icon')->nullable(); $table->string('place_id')->nullable(); $table->string('place_name')->nullable(); $table->string('place_icon')->nullable(); $table->time('deliver_time')->nullable(); $table->dateTime('deliver_date')->nullable(); $table->string('receive_lat')->nullable(); $table->string('receive_long')->nullable(); $table->string('receive_address')->nullable(); $table->string('deliver_lat')->nullable(); $table->string('deliver_long')->nullable(); $table->string('deliver_address')->nullable(); $table->string('coupon')->nullable(); $table->double('min_expected_price')->nullable(); $table->double('max_expected_price')->nullable(); $table->double('delivery_price')->nullable(); $table->double('price')->nullable(); $table->double('app_percentage')->nullable(); $table->double('added_value')->nullable(); $table->double('discount')->nullable(); $table->double('total_price')->nullable(); $table->enum('type',['special_stores','google_places','parcel_delivery','special_request'])->default('special_stores'); $table->enum('payment_type',['cash','online','wallet'])->default('cash'); $table->enum('payment_status',['true','false'])->default('false'); $table->enum('status',['open','inprogress','finished','closed'])->default('open'); $table->enum('store_status',['pending','accepted','prepare','prepared' , 'confirm_payment', 'delivered','rejected'])->default('pending'); $table->enum('delivery_status',['pending','accepted','delivering','reached_store','reached_receive_location','reached_deliver_location','delivered'])->default('pending'); $table->enum('have_invoice',['true','false'])->default('false'); $table->enum('needs_delivery',['true','false'])->default('true'); $table->dateTime('delegate_acceptance')->nullable(); $table->string('close_reason')->nullable(); $table->string('invoice_image')->nullable(); $table->text('description')->nullable(); $table->timestamps(); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::dropIfExists('orders'); } }
Back to File Manager