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

0001_01_01_000000_create_users_table.php 1.8KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <?php
  2. use Illuminate\Database\Migrations\Migration;
  3. use Illuminate\Database\Schema\Blueprint;
  4. use Illuminate\Support\Facades\Schema;
  5. use Wallo\FilamentCompanies\FilamentCompanies;
  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. $table->id();
  15. $table->string('name');
  16. $table->string('email')->unique();
  17. $table->timestamp('email_verified_at')->nullable();
  18. $table->string('password')->nullable(
  19. FilamentCompanies::hasSocialiteFeatures()
  20. );
  21. $table->rememberToken();
  22. $table->foreignId('current_company_id')->nullable();
  23. $table->foreignId('current_connected_account_id')->nullable();
  24. $table->string('profile_photo_path', 2048)->nullable();
  25. $table->timestamps();
  26. });
  27. Schema::create('password_reset_tokens', function (Blueprint $table) {
  28. $table->string('email')->primary();
  29. $table->string('token');
  30. $table->timestamp('created_at')->nullable();
  31. });
  32. Schema::create('sessions', function (Blueprint $table) {
  33. $table->string('id')->primary();
  34. $table->foreignId('user_id')->nullable()->index();
  35. $table->string('ip_address', 45)->nullable();
  36. $table->text('user_agent')->nullable();
  37. $table->longText('payload');
  38. $table->integer('last_activity')->index();
  39. });
  40. }
  41. /**
  42. * Reverse the migrations.
  43. */
  44. public function down(): void
  45. {
  46. Schema::dropIfExists('users');
  47. Schema::dropIfExists('password_reset_tokens');
  48. Schema::dropIfExists('sessions');
  49. }
  50. };