<?php
/**
 * Migration class for the 'employees_dayoff' 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 EmployeesDayoffTable
 *
 * @package RadiusTheme\RadiusBooking\Databases\Table
 * Migration for creating the 'employees_dayoff' table.
 */
class EmployeesDayoffTable extends Migration {
	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up(): void {
		Schema::create(
			$this->tablePrefix . 'employees_dayoff',
			function ( Blueprint $table ) {
				$table->id();
				$table->unsignedInteger( 'user_id' );
				$table->string( 'name' );
				$table->date( 'start_date' );
				$table->date( 'end_date' );
				$table->string( 'type' )->nullable();
				$table->boolean( 'recurring' )->default( 0 );
				$table->timestamps();
			}
		);
	}

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