40 lines
1.1 KiB
PHP
40 lines
1.1 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')->index()->comment('用户ID');
|
|
$table->string('consignee')->comment('收件人');
|
|
$table->string('telephone')->comment('电话');
|
|
$table->string('province')->comment('省');
|
|
$table->string('city')->comment('市');
|
|
$table->string('district')->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');
|
|
}
|
|
}
|