| 1234567891011121314151617181920212223242526272829303132333435363738394041 |
- <?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->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('brigadiers')->restrictOnDelete(); // бригадир
- $table->foreignId('order_status_id')->constrained('order_statuses')->restrictOnDelete(); // статус объекта
- $table->string('tg_group_name')->nullable();
- $table->string('tg_group_id')->nullable();
- $table->timestamps();
- });
- }
- /**
- * Reverse the migrations.
- */
- public function down(): void
- {
- Schema::dropIfExists('orders');
- }
- };
|