2025_09_22_162208_create_schedules_table.php 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738
  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('schedules', function (Blueprint $table) {
  13. $table->id();
  14. $table->date('installation_date');
  15. $table->boolean('manual')->default(false);
  16. $table->foreignId('order_id')->constrained('orders')->cascadeOnDelete();
  17. $table->foreignId('district_id')->constrained('districts')->cascadeOnDelete();
  18. $table->foreignId('area_id')->constrained('areas')->cascadeOnDelete();
  19. $table->text('object_address');
  20. $table->foreignId('object_type_id')->constrained('object_types')->cascadeOnDelete();
  21. $table->text('mafs');
  22. $table->integer('mafs_count');
  23. $table->foreignId('brigadier_id')->constrained('users')->cascadeOnDelete();
  24. $table->text('comment')->nullable();
  25. $table->timestamps();
  26. });
  27. }
  28. /**
  29. * Reverse the migrations.
  30. */
  31. public function down(): void
  32. {
  33. Schema::dropIfExists('schedules');
  34. }
  35. };