fix:sales_consultations 마이그레이션 테이블 존재 체크 추가

- 테이블이 없으면 건너뛰도록 수정
- 컬럼이 이미 존재하면 건너뛰도록 수정

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
pro
2026-01-30 15:15:53 +09:00
parent e407c40228
commit f30fbadc90

View File

@@ -11,6 +11,16 @@
*/
public function up(): void
{
// 테이블이 존재하지 않으면 건너뛰기
if (!Schema::hasTable('sales_consultations')) {
return;
}
// 컬럼이 이미 존재하면 건너뛰기
if (Schema::hasColumn('sales_consultations', 'gcs_uri')) {
return;
}
Schema::table('sales_consultations', function (Blueprint $table) {
$table->string('gcs_uri', 500)->nullable()->after('duration')
->comment('Google Cloud Storage URI (본사 연구용 백업)');
@@ -22,6 +32,14 @@ public function up(): void
*/
public function down(): void
{
if (!Schema::hasTable('sales_consultations')) {
return;
}
if (!Schema::hasColumn('sales_consultations', 'gcs_uri')) {
return;
}
Schema::table('sales_consultations', function (Blueprint $table) {
$table->dropColumn('gcs_uri');
});