fix: item_sections.page_id nullable 변경
- 섹션 템플릿(is_template=true)은 특정 페이지에 속하지 않으므로 page_id가 null 허용 - section-templates API 500 에러 해결
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
/**
|
||||
* item_sections.page_id nullable 변경
|
||||
*
|
||||
* 목적: 섹션 템플릿(is_template=true)은 특정 페이지에 속하지 않으므로
|
||||
* page_id가 null일 수 있어야 함
|
||||
*/
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('item_sections', function (Blueprint $table) {
|
||||
$table->unsignedBigInteger('page_id')->nullable()->comment('페이지 ID (템플릿은 null)')->change();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('item_sections', function (Blueprint $table) {
|
||||
$table->unsignedBigInteger('page_id')->nullable(false)->comment('페이지 ID')->change();
|
||||
});
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user