2019_08_05_170527_create_workers_table.php 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. use Illuminate\Support\Facades\Schema;
  3. use Illuminate\Database\Schema\Blueprint;
  4. use Illuminate\Database\Migrations\Migration;
  5. class CreateWorkersTable extends Migration
  6. {
  7. /**
  8. * Run the migrations.
  9. *
  10. * @return void
  11. */
  12. public function up()
  13. {
  14. Schema::create('workers', function (Blueprint $table) {
  15. $table->bigIncrements('id');
  16. $table->string('job_number', 20)->comment('工号');
  17. $table->string('account', 20)->comment('账号');
  18. $table->string('name', 20)->comment('姓名');
  19. $table->char('phone', 12)->comment('手机号');
  20. $table->bigInteger('area_id')->default(0)->comment('区域id');
  21. $table->bigInteger('admin_id')->default(0)->comment('管理员');
  22. $table->tinyInteger('status')->default(1);
  23. $table->timestamps();
  24. });
  25. }
  26. /**
  27. * Reverse the migrations.
  28. *
  29. * @return void
  30. */
  31. public function down()
  32. {
  33. Schema::dropIfExists('workers');
  34. }
  35. }