<?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::create('qr_selected_subscriptions', function (Blueprint $table) {
            $table->id('qr_subscription_id');
            $table->foreignId('Subscription_id')->references('qr_subscriptions_id')->on('qr_subscriptions');
            $table->foreignId('qr_subscription_user_id')->references('qr_user_id')->on('qr_users');
            $table->dateTime('qr_subscription_DateToBegin');
            $table->dateTime('qr_subscription_DateToEnd');

            // 0 => OFF , 1 => ON
            $table->integer('qr_subscription_State');
            // 0 => OFF , 1 => ON

            // 0 => Failed , 1 => Success
            $table->integer('qr_subscription_PaymentState');
            // 0 => Failed , 1 => Success

            $table->string('qr_subscription_duration')->nullable();
        });
    }

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