39 lines
1.0 KiB
PHP
39 lines
1.0 KiB
PHP
<?php
|
|
|
|
use Illuminate\Database\Migrations\Migration;
|
|
use Illuminate\Database\Schema\Blueprint;
|
|
use Illuminate\Support\Facades\Schema;
|
|
|
|
class CreateAddressesTable extends Migration
|
|
{
|
|
/**
|
|
* Run the migrations.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function up()
|
|
{
|
|
Schema::create('addresses', function (Blueprint $table) {
|
|
$table->id();
|
|
$table->unsignedBigInteger('user_id')->comment('地区ID');
|
|
$table->unsignedBigInteger('zone_id')->comment('地区ID');
|
|
$table->string('consignee')->comment('收件人');
|
|
$table->string('telephone')->comment('联系电话');
|
|
$table->string('zone')->comment('所在地区');
|
|
$table->string('address')->comment('详细地址');
|
|
$table->boolean('is_default')->default(false)->comment('是否默认');
|
|
$table->timestamps();
|
|
});
|
|
}
|
|
|
|
/**
|
|
* Reverse the migrations.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function down()
|
|
{
|
|
Schema::dropIfExists('addresses');
|
|
}
|
|
}
|