id(); $table->foreignId('tenant_id')->constrained()->cascadeOnDelete(); $table->string('name'); $table->unsignedInteger('version')->default(1); $table->string('title'); $table->longText('body'); $table->string('condition_type', 12)->default('always'); $table->unsignedBigInteger('condition_id')->nullable(); $table->text('notes')->nullable(); $table->timestamps(); $table->unique(['tenant_id', 'name', 'version']); }); Schema::table('contract_templates', function (Blueprint $table) { $table->json('annex_ids')->nullable()->after('cancellation_policy_id'); }); } /** * Reverse the migrations. */ public function down(): void { Schema::table('contract_templates', function (Blueprint $table) { $table->dropColumn('annex_ids'); }); Schema::dropIfExists('contract_annexes'); } };