2017_09_18_025109_create_user_address_table.php 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php
  2. use Illuminate\Support\Facades\Schema;
  3. use Illuminate\Database\Schema\Blueprint;
  4. use Illuminate\Database\Migrations\Migration;
  5. class CreateUserAddressTable extends Migration
  6. {
  7. /**
  8. * Run the migrations.
  9. *
  10. * @return void
  11. */
  12. public function up()
  13. {
  14. Schema::create('user_address', function (Blueprint $table) {
  15. $table->increments('id');
  16. $table->integer('user_id')->comment('所有人');
  17. $table->string('name', 60)->default('')->comment('联系人');
  18. $table->char('phone', 11)->comment('联系电话');
  19. $table->integer('area')->default(0)->comment('省市区编号');
  20. $table->string('address')->default('')->comment('省市区地址');
  21. $table->string('detail_address')->default('')->comment('详细地址');
  22. $table->tinyInteger('status')->default(1)->comment('默认状态');
  23. $table->timestamps();
  24. });
  25. }
  26. /**
  27. * Reverse the migrations.
  28. *
  29. * @return void
  30. */
  31. public function down()
  32. {
  33. Schema::dropIfExists('user_address');
  34. }
  35. }