<?php
/**
 * Migration class for the 'categories' table.
 */

namespace RadiusTheme\RadiusBooking\Databases\Table;

use RadiusTheme\RadiusBooking\Core\Database\Schema\Blueprint;
use RadiusTheme\RadiusBooking\Abstracts\Migration;
use RadiusTheme\RadiusBooking\Core\Database\Schema\Schema;
if ( ! defined( 'ABSPATH' ) ) {
	exit; // Exit if accessed directly
}
/**
 * Class CategoriesTable
 *
 * @package RadiusTheme\RadiusBooking\Databases\Table
 * Migration for creating the 'categories' table.
 */
class CategoriesTable extends Migration {
	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up(): void {
		Schema::create(
			$this->tablePrefix . 'categories',
			function ( Blueprint $table ) {
				$table->id();
				$table->string( 'name' );
				$table->string( 'status' )->default( 'active' );
				$table->integer( 'order_number' )->nullable();
				$table->bigInteger( 'image_id' );
				$table->json( 'translations' )->nullable()->default( null );
				$table->timestamps();
			}
		);
	}

	/**
	 * Reverse the migrations.
	 *
	 * @return void
	 */
	public function down(): void {
		Schema::drop( $this->tablePrefix . 'categories' );
	}
}
