Files
water-back/database/migrations/2023_01_11_132844_create_areas_table.php
2023-01-11 16:54:44 +08:00

42 lines
1.1 KiB
PHP

<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateAreasTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('areas', function (Blueprint $table) {
$table->id();
$table->unsignedBigInteger('user_id')->nullable()->index();
$table->string('title');
$table->string('mobile', 32);
$table->unsignedInteger('province_id');
$table->unsignedInteger('city_id');
$table->unsignedInteger('district_id');
$table->string('address');
$table->integer('stock')->default(0)->comment('库存');
$table->integer('sold')->default(0)->comment('领取数');
$table->boolean('status')->default(0);
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('areas');
}
}