2020_12_03_050018_create_account_interstitials_table.php 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <?php
  2. use Illuminate\Database\Migrations\Migration;
  3. use Illuminate\Database\Schema\Blueprint;
  4. use Illuminate\Support\Facades\Schema;
  5. class CreateAccountInterstitialsTable extends Migration
  6. {
  7. /**
  8. * Run the migrations.
  9. *
  10. * @return void
  11. */
  12. public function up()
  13. {
  14. Schema::create('account_interstitials', function (Blueprint $table) {
  15. $table->id();
  16. $table->unsignedInteger('user_id')->nullable()->index();
  17. $table->string('type')->nullable();
  18. $table->string('view')->nullable();
  19. $table->bigInteger('item_id')->unsigned()->nullable();
  20. $table->string('item_type')->nullable();
  21. $table->boolean('has_media')->default(false)->nullable();
  22. $table->string('blurhash')->nullable();
  23. $table->text('message')->nullable();
  24. $table->text('violation_header')->nullable();
  25. $table->text('violation_body')->nullable();
  26. $table->json('meta')->nullable();
  27. $table->text('appeal_message')->nullable();
  28. $table->timestamp('appeal_requested_at')->nullable()->index();
  29. $table->timestamp('appeal_handled_at')->nullable()->index();
  30. $table->timestamp('read_at')->nullable()->index();
  31. $table->timestamps();
  32. });
  33. Schema::table('users', function(Blueprint $table) {
  34. $table->boolean('has_interstitial')->default(false)->index();
  35. });
  36. }
  37. /**
  38. * Reverse the migrations.
  39. *
  40. * @return void
  41. */
  42. public function down()
  43. {
  44. Schema::dropIfExists('account_interstitials');
  45. Schema::table('users', function (Blueprint $table) {
  46. $table->dropColumn('has_interstitial');
  47. });
  48. }
  49. }