| 12345678910111213141516171819202122232425262728293031323334353637383940 |
- <?php
- use Illuminate\Database\Migrations\Migration;
- use Illuminate\Database\Schema\Blueprint;
- use Illuminate\Support\Facades\Schema;
- return new class extends Migration
- {
- /**
- * Run the migrations.
- */
- public function up(): void
- {
- Schema::create('orders', function (Blueprint $table) {
- $table->id();
- $table->foreignId('user_id')->constrained('users')->restrictOnDelete(); // менеджер
- $table->foreignId('district_id')->constrained('districts')->restrictOnDelete(); // округ
- $table->foreignId('area_id')->constrained('areas')->restrictOnDelete(); // район
- $table->string('object_address'); // адрес объекта
- $table->foreignId('object_type_id')->constrained('object_types')->restrictOnDelete(); // тип объекта
- $table->date('contract_date')->nullable(); // дата договора
- $table->string('contract_number')->nullable(); // номер дог-ра
- $table->text('comment')->nullable(); // комментарий
- $table->date('installation_date')->nullable(); // дата монтажа
- $table->foreignId('brigadier_id')->constrained('users')->restrictOnDelete(); // бригадир
- $table->foreignId('order_status_id')->constrained('order_statuses')->restrictOnDelete(); // статус объекта
- $table->string('tg_group_name')->nullable();
- $table->string('tg_group_link')->nullable();
- $table->timestamps();
- });
- }
- /**
- * Reverse the migrations.
- */
- public function down(): void
- {
- Schema::dropIfExists('orders');
- }
- };
|