You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

46 lines
1.3 KiB

2 years ago
  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. * @return void
  11. */
  12. public function up()
  13. {
  14. Schema::create('files', function (Blueprint $table) {
  15. $table->uuid('uuid')->primary();
  16. $table->string("original_name")->nullable();
  17. $table->string("ext");
  18. $table->string("mimetype");
  19. $table->string("server_path");
  20. $table->bigInteger("width")->nullable();
  21. $table->bigInteger("height")->nullable();
  22. $table->bigInteger("file_size")->nullable();
  23. $table->bigInteger("sort")->nullable();
  24. $table->json("alts")->nullable();
  25. $table->string("description")->nullable();
  26. $table->unsignedBigInteger("user_id")->nullable();
  27. $table->string("ip")->nullable();
  28. $table->unsignedBigInteger("collection_id")->nullable();
  29. $table->timestamp("published_at")->nullable();
  30. $table->timestamps();
  31. $table->softDeletes();
  32. });
  33. }
  34. /**
  35. * Reverse the migrations.
  36. *
  37. * @return void
  38. */
  39. public function down()
  40. {
  41. Schema::dropIfExists('files');
  42. }
  43. };