2024_05_20_083159_create_group_media_table.php 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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('group_media', function (Blueprint $table) {
  13. $table->bigIncrements('id');
  14. $table->unsignedBigInteger('group_id');
  15. $table->unsignedBigInteger('profile_id');
  16. $table->unsignedBigInteger('status_id')->nullable()->index();
  17. $table->string('media_path')->unique();
  18. $table->text('thumbnail_url')->nullable();
  19. $table->text('cdn_url')->nullable();
  20. $table->text('url')->nullable();
  21. $table->string('mime')->nullable();
  22. $table->unsignedInteger('size')->nullable();
  23. $table->text('cw_summary')->nullable();
  24. $table->string('license')->nullable();
  25. $table->string('blurhash')->nullable();
  26. $table->tinyInteger('order')->unsigned()->default(1);
  27. $table->unsignedInteger('width')->nullable();
  28. $table->unsignedInteger('height')->nullable();
  29. $table->boolean('local_user')->default(true);
  30. $table->boolean('is_cached')->default(false);
  31. $table->boolean('is_comment')->default(false)->index();
  32. $table->json('metadata')->nullable();
  33. $table->string('version')->default(1);
  34. $table->boolean('skip_optimize')->default(false);
  35. $table->timestamp('processed_at')->nullable();
  36. $table->timestamp('thumbnail_generated')->nullable();
  37. $table->timestamps();
  38. });
  39. }
  40. /**
  41. * Reverse the migrations.
  42. */
  43. public function down(): void
  44. {
  45. Schema::dropIfExists('group_media');
  46. }
  47. };