2018_05_04_054007_create_reports_table.php 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?php
  2. use Illuminate\Database\Migrations\Migration;
  3. use Illuminate\Database\Schema\Blueprint;
  4. use Illuminate\Support\Facades\Schema;
  5. class CreateReportsTable extends Migration
  6. {
  7. /**
  8. * Run the migrations.
  9. *
  10. * @return void
  11. */
  12. public function up()
  13. {
  14. Schema::create('reports', function (Blueprint $table) {
  15. $table->bigIncrements('id');
  16. $table->bigInteger('profile_id')->unsigned();
  17. $table->bigInteger('user_id')->unsigned()->nullable();
  18. $table->bigInteger('object_id')->unsigned();
  19. $table->string('object_type')->nullable();
  20. $table->bigInteger('reported_profile_id')->unsigned()->nullable();
  21. $table->string('type')->nullable();
  22. $table->string('message')->nullable();
  23. $table->timestamp('admin_seen')->nullable();
  24. $table->boolean('not_interested')->default(false);
  25. $table->boolean('spam')->default(false);
  26. $table->boolean('nsfw')->default(false);
  27. $table->boolean('abusive')->default(false);
  28. $table->json('meta')->nullable();
  29. $table->unique(['user_id', 'object_type', 'object_id']);
  30. $table->timestamps();
  31. });
  32. }
  33. /**
  34. * Reverse the migrations.
  35. *
  36. * @return void
  37. */
  38. public function down()
  39. {
  40. Schema::dropIfExists('reports');
  41. }
  42. }