<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration {
    public function up(): void {
        Schema::table('projects', function (Blueprint $table) {
            $table->string('type')->nullable(); // Thêm cột loại hình dự án
            $table->foreignUuid('payment_template_id')->nullable()->constrained('payment_templates')->nullOnDelete();
        });
    }

    public function down(): void {
        Schema::table('projects', function (Blueprint $table) {
            $table->dropForeign(['payment_template_id']);
            $table->dropColumn(['payment_template_id', 'type']);
        });
    }
};
