dstpabuaran.com/database/migrations/2026_06_11_100000_create_attendances_table.php
Yoga Pangestu 660d0a648c feat: create migration files for various tables including rejections, attendances, payrolls, leave requests, purchases, and stock mutations
- Added `rejections` table to track rejection reasons and related entities.
- Created `attendances` table for employee attendance records with geolocation data.
- Introduced `payroll_periods`, `payrolls`, and `payroll_adjustments` tables for payroll management.
- Established `leave_requests` table to manage employee leave applications.
- Implemented `purchases` and `purchase_items` tables for tracking supplier purchases.
- Created `media` table for file storage and management.
- Added `activity_log` table for tracking system activities.
- Established `orders` and `order_items` tables for managing customer orders.
- Created `cuttings`, `cutting_materials`, and `cutting_results` tables for production management.
- Introduced `system_configurations` table for application settings.
- Added `push_subscriptions` table for managing user push notifications.
- Created `homepage_configurations` table for homepage settings.
- Established `product_prices` table for managing product pricing.
- Added `owner_verification_requests` table for tracking ownership verification processes.
- Created `notifications` table for user notifications.
- Established `employee_advance_payments` table for managing advance payments to employees.
- Created `retail_stock_histories` table for tracking stock changes.
- Established `stok_opnames` and `stok_opname_items` tables for stock opname management.
- Created `cutting_material_combinations` table for managing material combinations.
- Added `restocks` and `restock_items` tables for managing stock replenishments.
- Established `stock_mutations` table for tracking stock changes across various operations.
2026-07-28 18:51:00 +07:00

35 lines
1.1 KiB
PHP

<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
public function up(): void
{
Schema::create('attendances', function (Blueprint $table) {
$table->id();
$table->foreignId('employee_id')->constrained()->cascadeOnDelete();
$table->date('attendance_date');
$table->dateTime('check_in_at');
$table->dateTime('check_out_at')->nullable();
$table->decimal('check_in_latitude', 10, 7)->nullable();
$table->decimal('check_in_longitude', 10, 7)->nullable();
$table->decimal('check_out_latitude', 10, 7)->nullable();
$table->decimal('check_out_longitude', 10, 7)->nullable();
$table->unsignedInteger('work_duration_minutes')->nullable();
$table->timestamp('created_at')->useCurrent();
$table->timestamp('updated_at')->useCurrent()->useCurrentOnUpdate();
});
}
public function down(): void
{
Schema::dropIfExists('attendances');
}
};