<?php

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

return new class extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::table('items_history', function (Blueprint $table) {
            $table->dropColumn('subscription_start_date');
            $table->dropColumn('subscription_renewal_date');
            $table->dropColumn('subscription_status');
        });
        Schema::create('subscription', function (Blueprint $table) {
            $table->dateTime('subscription_start_date')->nullable();
            $table->dateTime('subscription_renewal_date')->nullable();
            $table->string('subscription_status')->nullable();
            $table->foreignId('cart_id')->constrained('carts')->nullable();
            $table->foreignId('item_id')->constrained('items')->nullable();
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        //
    }
};
