2023_07_07_025757_create_remote_auths_table.php 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738
  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. /**
  8. * Run the migrations.
  9. */
  10. public function up(): void
  11. {
  12. Schema::create('remote_auths', function (Blueprint $table) {
  13. $table->id();
  14. $table->string('software')->nullable();
  15. $table->string('domain')->nullable()->index();
  16. $table->string('webfinger')->nullable()->unique()->index();
  17. $table->unsignedInteger('instance_id')->nullable()->index();
  18. $table->unsignedInteger('user_id')->nullable()->unique()->index();
  19. $table->unsignedInteger('client_id')->nullable()->index();
  20. $table->string('ip_address')->nullable();
  21. $table->text('bearer_token')->nullable();
  22. $table->json('verify_credentials')->nullable();
  23. $table->timestamp('last_successful_login_at')->nullable();
  24. $table->timestamp('last_verify_credentials_at')->nullable();
  25. $table->timestamps();
  26. });
  27. }
  28. /**
  29. * Reverse the migrations.
  30. */
  31. public function down(): void
  32. {
  33. Schema::dropIfExists('remote_auths');
  34. }
  35. };