<?php

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

return new class extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('member_courses', function (Blueprint $table) {
            $table->unsignedBigInteger('course_type_id')->nullable();
            $table->foreign('course_type_id')->nullable()->references('id')->on('course_types')->onUpdate('cascade')->onDelete('cascade');
            $table->integer('status');
            $table->decimal('price', $precision = 8, $scale = 2);
            $table->string('months')->nullable();
            $table->string('notes')->nullable();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('member_courses', function (Blueprint $table) {
            $table->dropColumn('course_type_id');
            $table->dropColumn('status');
            $table->dropColumn('price');
            $table->dropColumn('months');
            $table->dropColumn('notes');
        });
    }
};
