2018_04_16_002611_create_profiles_table.php 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <?php
  2. use Illuminate\Database\Migrations\Migration;
  3. use Illuminate\Database\Schema\Blueprint;
  4. use Illuminate\Support\Facades\Schema;
  5. class CreateProfilesTable extends Migration
  6. {
  7. /**
  8. * Run the migrations.
  9. *
  10. * @return void
  11. */
  12. public function up()
  13. {
  14. Schema::create('profiles', function (Blueprint $table) {
  15. $table->bigIncrements('id');
  16. $table->unsignedInteger('user_id')->nullable();
  17. $table->string('domain')->nullable();
  18. $table->string('username')->nullable()->index();
  19. $table->string('name')->nullable();
  20. $table->string('bio', 150)->nullable();
  21. $table->string('location')->nullable();
  22. $table->string('website')->nullable();
  23. $table->text('keybase_proof')->nullable();
  24. $table->boolean('is_private')->default(false);
  25. // ActivityPub
  26. $table->string('sharedInbox')->nullable()->index();
  27. // PuSH/WebSub
  28. $table->string('verify_token')->nullable();
  29. $table->string('secret')->nullable();
  30. // RSA Key Pair
  31. $table->text('private_key')->nullable();
  32. $table->text('public_key')->nullable();
  33. // URLs
  34. $table->string('remote_url')->nullable();
  35. $table->string('salmon_url')->nullable();
  36. $table->string('hub_url')->nullable();
  37. $table->unique(['domain', 'username']);
  38. $table->timestamps();
  39. });
  40. }
  41. /**
  42. * Reverse the migrations.
  43. *
  44. * @return void
  45. */
  46. public function down()
  47. {
  48. Schema::dropIfExists('profiles');
  49. }
  50. }