feat: add shift management functionality

This commit is contained in:
2026-08-26 18:53:15 +03:30
parent 2d96978c38
commit aeef95339d
34 changed files with 1953 additions and 15 deletions
@@ -0,0 +1,38 @@
<?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('shifts', function (Blueprint $table) {
$table->id();
$table->string('day_of_week')->nullable();
$table->date('date')->nullable();
$table->time('start_time');
$table->time('end_time');
$table->boolean('is_active')->default(true);
$table->timestamps();
$table->foreignId('user_id')->nullable()->constrained('users')->nullOnDelete();
$table->foreignId('created_by')->nullable()->constrained('users')->nullOnDelete();
$table->index(['day_of_week', 'is_active']);
$table->index(['date', 'is_active']);
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('shifts');
}
};