2025_12_04_000007_create_attachments_table.php 664 B

1234567891011121314151617181920212223242526
  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. public function up(): void
  8. {
  9. Schema::create('attachments', function (Blueprint $table) {
  10. $table->id();
  11. $table->morphs('attachable');
  12. $table->string('filename');
  13. $table->string('filepath');
  14. $table->string('mime_type', 100);
  15. $table->unsignedBigInteger('size');
  16. $table->timestamps();
  17. });
  18. }
  19. public function down(): void
  20. {
  21. Schema::dropIfExists('attachments');
  22. }
  23. };