2021_08_12_095427_create_department_table.php 814 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php
  2. use Illuminate\Database\Migrations\Migration;
  3. use Illuminate\Database\Schema\Blueprint;
  4. use Illuminate\Support\Facades\Schema;
  5. class CreateDepartmentTable extends Migration
  6. {
  7. /**
  8. * Run the migrations.
  9. *
  10. * @return void
  11. */
  12. public function up()
  13. {
  14. Schema::create('department', function (Blueprint $table) {
  15. $table->id();
  16. $table->string('name');
  17. $table->integer('pid')->default(0);
  18. $table->integer('sort')->default(0);
  19. $table->tinyInteger('status')->default(1);
  20. $table->softDeletes();
  21. $table->timestamps();
  22. });
  23. }
  24. /**
  25. * Reverse the migrations.
  26. *
  27. * @return void
  28. */
  29. public function down()
  30. {
  31. Schema::dropIfExists('department');
  32. }
  33. }