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->string('ref_code')->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('car_type_id')->nullable()->constrained()->references('id')->on('cartypes')->onDelete('set null'); $table->foreignId('company_id')->nullable()->constrained()->references('id')->on('users')->onDelete('set null'); $table->foreignId('category_id')->nullable()->constrained()->references('id')->on('categories')->onDelete('set null'); $table->foreignId('starting_city_id')->nullable()->constrained()->references('id')->on('cities')->onDelete('set null'); $table->foreignId('destination_city_id')->nullable()->constrained()->references('id')->on('cities')->onDelete('set null'); $table->string('company_name')->nullable(); $table->string('company_icon')->nullable(); $table->string('received_by_me')->default(1); $table->string('receiver_phone')->nullable(); $table->string('additional_phone')->nullable(); $table->string('receiver_name')->nullable(); $table->string('country_key')->nullable(); $table->integer('cargo')->default(0); $table->integer('amount')->default(0); $table->boolean('need_shipping')->default(false); $table->boolean('is_scheduled')->default(false); $table->boolean('code_submitted')->default(false); $table->enum('deposite',['true','false'])->default('false'); $table->enum('have_invoice',['true','false'])->default('false'); $table->string('invoice_number')->nullable(); $table->enum('timing',['now','scheduled'])->nullable()->default('now'); $table->string('deliver_time')->nullable(); $table->boolean('payment_confirmed')->default(false); $table->string('deliver_date')->nullable(); $table->string('invoice_image')->nullable(); $table->enum('invoice_accepted',['true','false','refused'])->default('false'); $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('place_id')->nullable(); $table->string('place_name')->nullable(); $table->string('place_icon')->nullable(); $table->string('coupon')->nullable(); $table->double('deposit')->nullable(); $table->double('remain')->nullable(); $table->double('delivery_price')->nullable(); $table->double('price')->nullable(); $table->double('app_percentage')->nullable(); $table->double('added_value')->nullable(); $table->double('shipping_price')->nullable(); $table->double('discount')->nullable(); $table->double('total_price')->nullable(); $table->enum('type',['shipment','auctions','special_request'])->default('special_request'); $table->enum('provider_type',['individual','company','all'])->default('all'); $table->enum('payment_type',['cash','online','wallet','not_determined_yet'])->default('not_determined_yet'); $table->enum('payment_status',['true','false'])->default('false'); $table->enum('status',['open','inprogress','finished','closed','canceled'])->default('open'); $table->enum('delivery_status',['pending','accepted','delivering','reached_store','reached_receive_location','reached_deliver_location','delivered'])->default('pending'); $table->enum('needs_delivery',['true','false'])->default('true'); $table->dateTime('delegate_acceptance')->nullable(); $table->string('close_reason')->nullable(); $table->integer('is_settlement')->default(0); $table->integer('deposit_is_returned')->default(0); $table->text('description')->nullable(); $table->timestamps(); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::dropIfExists('orders'); } }
Back to File Manager