2025_08_08_161031_create_company_activities_table.php 978 B

12345678910111213141516171819202122232425262728293031323334
  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. public function up(): void
  12. {
  13. Schema::create('company_activities', function (Blueprint $table) {
  14. $table->id();
  15. $table->unsignedBigInteger('company_id')->nullable();
  16. $table->foreign('company_id')->nullable()->references('id')->on('companies')->onUpdate('cascade')->onDelete('cascade');
  17. $table->string('name');
  18. $table->text('description')->nullable();
  19. $table->boolean('enabled')->default(1);
  20. $table->softDeletes();
  21. $table->timestamps();
  22. });
  23. }
  24. /**
  25. * Reverse the migrations.
  26. */
  27. public function down(): void
  28. {
  29. Schema::dropIfExists('company_activities');
  30. }
  31. };