EscolaLMS/Cart

View on GitHub
database/migrations/2024_03_01_113545_add_trial_fields_to_products_table.php

Summary

Maintainability
A
0 mins
Test Coverage
<?php

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

class AddTrialFieldsToProductsTable extends Migration
{
    public function up(): void
    {
        Schema::table('products', function (Blueprint $table) {
            $table->boolean('has_trial')->nullable();
            $table->string('trial_period')->nullable();
            $table->integer('trial_duration')->nullable();
        });
    }

    public function down(): void
    {
        Schema::table('products', function (Blueprint $table) {
            $table->dropColumn('has_trial');
            $table->string('trial_period');
            $table->dropColumn('trial_duration');
        });
    }
}