| 123456789101112131415161718192021222324252627282930313233343536 |
- <?php
- use Illuminate\Database\Migrations\Migration;
- use Illuminate\Database\Schema\Blueprint;
- use Illuminate\Support\Facades\Schema;
- /*
- * Миграция: создаёт таблицу dict_sections — разделы справочников.
- * Создана: 2026-05-06
- * code — уникальный строковый идентификатор ('makes', 'body_types', 'colors_ext' и т.д.)
- * is_system — защита от удаления через UI (системные разделы заполняются DictionarySeeder)
- * is_hierarchical — если true: значения двухуровневые (Марка → Модели), иначе плоский список
- * Нет timestamps — статичные справочные данные не требуют отслеживания времени
- */
- return new class extends Migration
- {
- public function up(): void
- {
- Schema::create('dict_sections', function (Blueprint $table) {
- $table->unsignedBigInteger('id')->autoIncrement();
- $table->string('code', 64)->unique();
- $table->string('label', 128);
- $table->boolean('is_system')->default(false);
- $table->boolean('is_hierarchical')->default(false);
- $table->smallInteger('sort_order')->default(0);
- });
- }
- /**
- * Reverse the migrations.
- */
- public function down(): void
- {
- Schema::dropIfExists('dict_sections');
- }
- };
|