|
@@ -0,0 +1,40 @@
|
|
|
|
|
+<?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('client_id')->constrained('clients')->restrictOnDelete(); // клиент
|
|
|
|
|
+ $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->string('object_type')->nullable(); // тип объекта
|
|
|
|
|
+ $table->date('contract_date')->nullable(); // дата договора
|
|
|
|
|
+ $table->string('contract_number')->nullable(); // номер дог-ра
|
|
|
|
|
+ $table->text('comment')->nullable(); // комментарий
|
|
|
|
|
+ $table->date('installation_date')->nullable(); // дата монтажа
|
|
|
|
|
+ $table->string('brigadier')->nullable(); // бригадир
|
|
|
|
|
+ $table->string('tg_group_name')->nullable();
|
|
|
|
|
+ $table->string('tg_group_id')->nullable();
|
|
|
|
|
+ $table->timestamps();
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Reverse the migrations.
|
|
|
|
|
+ */
|
|
|
|
|
+ public function down(): void
|
|
|
|
|
+ {
|
|
|
|
|
+ Schema::dropIfExists('orders');
|
|
|
|
|
+ }
|
|
|
|
|
+};
|