<?php

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

class RemoveColsFromInvoices extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('invoices', function (Blueprint $table) {
            $table->dropColumn('id');
            $table->dropColumn('invoice_owner_id');
            $table->dropColumn('customer_id');
            $table->dropColumn('currency_id');
            $table->dropColumn('status');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('invoices', function (Blueprint $table) {
            $table->id();
            $table->bigInteger('invoice_owner_id')->comment('Select the name of the user to whom the invoice is assigned'); // Select the name of the user to whom the invoice is assigned.
            $table->bigInteger('customer_id')->nullable();
            $table->bigInteger('currency_id')->nullable();
            $table->enum('status',['draft', 'sent', 'open', 'revised', 'declined'])->default('draft');

        });
    }
}
