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

namespace RadiusTheme\RadiusBooking\Databases\Table;

if ( ! defined( 'ABSPATH' ) ) {
	exit; // Exit if accessed directly
}
use RadiusTheme\RadiusBooking\Core\Database\Schema\Blueprint;
use RadiusTheme\RadiusBooking\Abstracts\Migration;
use RadiusTheme\RadiusBooking\Core\Database\Schema\Schema;
/**
 * Class EmployeesSpecialDaysTable
 *
 * @package RadiusTheme\RadiusBooking\Databases\Table
 * Migration for creating the 'employees_special_days' table.
 */
class EmployeesSpecialDaysTable extends Migration {
	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up(): void {
		Schema::create(
			$this->tablePrefix . 'employees_special_days',
			function ( Blueprint $table ) {
				$table->id();
				$table->unsignedBigInteger( 'user_id' )->index();
				$table->string( 'name' )->index();
				$table->date( 'start_date' );
				$table->date( 'end_date' );
				$table->timestamps();
			}
		);
	}

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