style: Laravel Pint 코드 포맷팅 적용
- PSR-12 스타일 가이드 준수 - 302개 파일 스타일 이슈 자동 수정 - 코드 로직 변경 없음 (포맷팅만)
This commit is contained in:
@@ -2,8 +2,8 @@
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
@@ -11,7 +11,7 @@ public function up(): void
|
||||
{
|
||||
Schema::table('materials', function (Blueprint $table) {
|
||||
// category_id
|
||||
if (!Schema::hasColumn('materials', 'category_id')) {
|
||||
if (! Schema::hasColumn('materials', 'category_id')) {
|
||||
$table->unsignedBigInteger('category_id')
|
||||
->nullable()
|
||||
->after('tenant_id')
|
||||
@@ -20,7 +20,7 @@ public function up(): void
|
||||
}
|
||||
|
||||
// item_name
|
||||
if (!Schema::hasColumn('materials', 'item_name')) {
|
||||
if (! Schema::hasColumn('materials', 'item_name')) {
|
||||
$table->string('item_name', 255)
|
||||
->nullable()
|
||||
->after('name')
|
||||
@@ -40,10 +40,19 @@ public function up(): void
|
||||
public function down(): void
|
||||
{
|
||||
// FK 제거 시도
|
||||
try { DB::statement('ALTER TABLE materials DROP FOREIGN KEY materials_category_id_foreign'); } catch (\Throwable $e) {}
|
||||
try {
|
||||
DB::statement('ALTER TABLE materials DROP FOREIGN KEY materials_category_id_foreign');
|
||||
} catch (\Throwable $e) {
|
||||
}
|
||||
|
||||
// 컬럼 제거
|
||||
try { DB::statement('ALTER TABLE materials DROP COLUMN category_id'); } catch (\Throwable $e) {}
|
||||
try { DB::statement('ALTER TABLE materials DROP COLUMN item_name'); } catch (\Throwable $e) {}
|
||||
try {
|
||||
DB::statement('ALTER TABLE materials DROP COLUMN category_id');
|
||||
} catch (\Throwable $e) {
|
||||
}
|
||||
try {
|
||||
DB::statement('ALTER TABLE materials DROP COLUMN item_name');
|
||||
} catch (\Throwable $e) {
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user