2025_09_23_195123_create_email_attachments_table.php 928 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php
  2. use Illuminate\Database\Migrations\Migration;
  3. use Illuminate\Database\Schema\Blueprint;
  4. use Illuminate\Support\Facades\Schema;
  5. use App\Database\Migrations\TenantMigration;
  6. return new class extends TenantMigration
  7. {
  8. /**
  9. * Run the migrations.
  10. *
  11. * @return void
  12. */
  13. public function up()
  14. {
  15. Schema::create('email_attachments', function (Blueprint $table) {
  16. $table->id();
  17. $table->unsignedBigInteger('template_id')->nullable();
  18. $table->string('name');
  19. $table->string('path');
  20. $table->integer('size');
  21. $table->timestamps();
  22. $table->foreign('template_id')->references('id')->on('email_templates')->onDelete('set null');
  23. });
  24. }
  25. /**
  26. * Reverse the migrations.
  27. *
  28. * @return void
  29. */
  30. public function down()
  31. {
  32. Schema::dropIfExists('email_attachments');
  33. }
  34. };