| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- <?php
- use Illuminate\Database\Migrations\Migration;
- use Illuminate\Database\Schema\Blueprint;
- use Illuminate\Support\Facades\Schema;
- class CreateBillingModelsTable extends Migration
- {
- /**
- * Run the migrations.
- *
- * @return void
- */
- public function up()
- {
- Schema::create('billing_models', function (Blueprint $table) {
- $table->bigIncrements('id');
- $table->timestamps();
- $table->bigInteger('carrier_id')->index()->comment('承运商');
- $table->bigInteger('province_id')->index()->comment('省份');
- $table->bigInteger('city_id')->index()->comment('城市');
- $table->bigInteger('unit_id')->index()->comment('货物单位');
- $table->decimal('range_min')->index()->nullable()->comment('区间最小值');
- $table->decimal('range_max')->index()->nullable()->comment('区间最大值');
- $table->decimal('unit_price')->comment('单价(元)');
- $table->decimal('base_fee')->default(0)->comment('起步费');
- $table->decimal('initial_weight')->default(0)->comment('始重');
- /* //外键
- $table->foreign('carrier_id')->references('id')->on('carrier'); //承运商
- $table->foreign('province_id')->references('id')->on('provinces'); //省份
- $table->foreign('city_id')->references('id')->on('citys'); //城市
- $table->foreign('unit_id')->references('id')->on('units'); //单位*/
- });
- }
- /**
- * Reverse the migrations.
- *
- * @return void
- */
- public function down()
- {
- Schema::dropIfExists('billing_models');
- }
- }
|