2023_04_26_024500_create_user_table.php 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <?php
  2. use Illuminate\Database\Migrations\Migration;
  3. use Illuminate\Database\Schema\Blueprint;
  4. use Illuminate\Support\Facades\Schema;
  5. return new class extends Migration {
  6. /**
  7. * Run the migrations.
  8. *
  9. * @return void
  10. */
  11. public function up()
  12. {
  13. Schema::create('user', function (Blueprint $table) {
  14. $table->id();
  15. $table->string("phone")->default("");
  16. $table->string("password")->default("");
  17. $table->string("email")->default("");
  18. $table->unsignedTinyInteger("status")->default(0)->comment("0 禁用 1启用");
  19. $table->unsignedInteger("group_id")->default(0);
  20. $table->string("extra",2000)->default("")->comment("糊屎字段");
  21. $table->timestamps();
  22. });
  23. Schema::create('admin_group', function (Blueprint $table) {
  24. $table->id();
  25. $table->string("name")->default("");
  26. $table->timestamps();
  27. });
  28. Schema::create('admin_permission', function (Blueprint $table) {
  29. $table->id();
  30. $table->string("name")->default("");
  31. $table->string("code")->default("");
  32. $table->timestamps();
  33. });
  34. }
  35. /**
  36. * Reverse the migrations.
  37. *
  38. * @return void
  39. */
  40. public function down()
  41. {
  42. Schema::dropIfExists('user');
  43. Schema::dropIfExists('admin_group');
  44. Schema::dropIfExists('admin_permission');
  45. }
  46. };