您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

47 行
1.4KB

  1. <?php
  2. use App\Util\MigrationHelper;
  3. use Illuminate\Database\Migrations\Migration;
  4. use Illuminate\Database\Schema\Blueprint;
  5. use Illuminate\Support\Facades\Schema;
  6. return new class extends Migration
  7. {
  8. /**
  9. * Run the migrations.
  10. */
  11. public function up(): void
  12. {
  13. Schema::create('users', function (Blueprint $table) {
  14. $helper = new MigrationHelper($table);
  15. $helper->baseColumn();
  16. $table->string('email')->unique()->comment('Email');
  17. $table->string('password')->comment('ログインパスワード');
  18. $table->string('kintone_id')->comment('KintoneID');
  19. $helper->index(1, ['email']);
  20. $helper->index(2, ['kintone_id']);
  21. });
  22. Schema::create('user_histories', function (Blueprint $table) {
  23. $helper = new MigrationHelper($table, true);
  24. $helper->baseColumn();
  25. $table->string('email')->comment('Email');
  26. $table->string('password')->comment('ログインパスワード');
  27. $table->string('kintone_id')->comment('KintoneID');
  28. $helper->index(1, ['email']);
  29. $helper->index(2, ['kintone_id']);
  30. });
  31. }
  32. /**
  33. * Reverse the migrations.
  34. */
  35. public function down(): void
  36. {
  37. Schema::dropIfExists('users');
  38. Schema::dropIfExists('user_histories');
  39. }
  40. };