ufutx.dma/database/migrations/2023_02_03_152251_create_agencies_table.php
2026-03-04 14:42:40 +08:00

39 lines
1.0 KiB
PHP
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('agencies', function (Blueprint $table) {
$table->id();
$table->integer('partner_id')->unsigned();
$table->enum('grade', ['P','C'])->comment("代理等级 P:省级C:市级");
$table->string('pro_id', 6)->comment("省codeid");
$table->string('city_id', 6)->comment("市codeid")->nullable();
$table->string('province', 50)->nullable();
$table->string('city', 50)->nullable();
$table->timestamps();
$table->unique(['partner_id','pro_id', 'city_id']);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('agencies');
}
};