erp/database/migrations/2023_07_27_184020_create_waybills_table.php

75 lines
2.3 KiB
PHP
Raw Permalink Normal View History

2023-07-27 21:28:00 +08:00
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateWaybillsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
if (Schema::hasTable('waybills')) {
return;
}
Schema::create('waybills', function (Blueprint $table) {
$table->bigIncrements('id');
$table->integer('shop_id');
$table->string('request_id')->default('');
$table->text('encryptedData')->nullable();
$table->string('signature')->default('');
$table->string('templateUrl');
$table->string('ver')->default('');
$table->string('waybill_code')->default('');
$table->string('object_id', 32);
$table->integer('key')->default(0);
$table->string('sender_country');
$table->string('sender_province');
$table->string('sender_city');
$table->string('sender_district');
$table->string('sender_detail');
$table->string('sender_name');
$table->integer('sender_mobile');
$table->string('recipient_country')->default('');
$table->string('recipient_province');
$table->string('recipient_city');
$table->string('recipient_district');
$table->string('recipient_detail');
$table->string('recipient_name');
2023-07-28 15:35:47 +08:00
$table->string('recipient_mobile', 16);
2023-07-27 21:28:00 +08:00
2023-07-28 15:35:47 +08:00
$table->string('user_id');
2023-07-27 21:28:00 +08:00
$table->string('wp_code');
$table->string('order_channels_type')->default('PDD');
$table->string('order_sn');
2023-07-29 17:57:36 +08:00
$table->integer('order_id');
2023-08-15 16:33:36 +08:00
$table->integer('participate_no')->default(0);
2023-08-18 16:54:04 +08:00
$table->integer('timed_delivery')->default(247);
2023-08-15 16:33:36 +08:00
$table->string('note')->nullable();
2023-07-27 21:28:00 +08:00
$table->text('items');
2023-07-28 15:35:47 +08:00
$table->tinyInteger('cancel')->default(0);
2023-07-27 21:28:00 +08:00
$table->timestamps();
$table->index('object_id');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('waybills');
}
}