Commit 299e67a6 authored by Mahmoud Aglan's avatar Mahmoud Aglan

Fix 2 boot failures: reservations.updated_by missing, sa_coaches.payment_model NULL

- reservations: added updated_by column (model has autoTrackAuthor=true but column didn't exist)
- sa_coaches: academy coaches now default to payment_model='salary' instead of NULL (NOT NULL column)
- Also applied column fix directly to live DB via SSH
Co-Authored-By: 's avatarClaude Opus 4.6 <noreply@anthropic.com>
parent 3b3eff80
...@@ -171,7 +171,7 @@ class CoachController extends Controller ...@@ -171,7 +171,7 @@ class CoachController extends Controller
'employment_type' => $employmentType, 'employment_type' => $employmentType,
'coach_type' => $coachType, 'coach_type' => $coachType,
'academy_id' => $academyId, 'academy_id' => $academyId,
'payment_model' => $coachType === 'academy' ? null : ($paymentModel ?: null), 'payment_model' => $coachType === 'academy' ? 'salary' : ($paymentModel ?: 'per_session'),
'hourly_rate' => $coachType === 'academy' ? null : ($hourlyRate !== '' ? (float) $hourlyRate : null), 'hourly_rate' => $coachType === 'academy' ? null : ($hourlyRate !== '' ? (float) $hourlyRate : null),
'session_rate' => $coachType === 'academy' ? null : ($sessionRate !== '' ? (float) $sessionRate : null), 'session_rate' => $coachType === 'academy' ? null : ($sessionRate !== '' ? (float) $sessionRate : null),
'monthly_rate' => $coachType === 'academy' ? null : ($monthlyRate !== '' ? (float) $monthlyRate : null), 'monthly_rate' => $coachType === 'academy' ? null : ($monthlyRate !== '' ? (float) $monthlyRate : null),
...@@ -364,7 +364,7 @@ class CoachController extends Controller ...@@ -364,7 +364,7 @@ class CoachController extends Controller
'employment_type' => $employmentType, 'employment_type' => $employmentType,
'coach_type' => $coachType, 'coach_type' => $coachType,
'academy_id' => $academyId, 'academy_id' => $academyId,
'payment_model' => $coachType === 'academy' ? null : ($paymentModel ?: null), 'payment_model' => $coachType === 'academy' ? 'salary' : ($paymentModel ?: 'per_session'),
'hourly_rate' => $coachType === 'academy' ? null : ($hourlyRate !== '' ? (float) $hourlyRate : null), 'hourly_rate' => $coachType === 'academy' ? null : ($hourlyRate !== '' ? (float) $hourlyRate : null),
'session_rate' => $coachType === 'academy' ? null : ($sessionRate !== '' ? (float) $sessionRate : null), 'session_rate' => $coachType === 'academy' ? null : ($sessionRate !== '' ? (float) $sessionRate : null),
'monthly_rate' => $coachType === 'academy' ? null : ($monthlyRate !== '' ? (float) $monthlyRate : null), 'monthly_rate' => $coachType === 'academy' ? null : ($monthlyRate !== '' ? (float) $monthlyRate : null),
......
<?php
declare(strict_types=1);
return [
'up' => "ALTER TABLE `reservations` ADD COLUMN `updated_by` BIGINT UNSIGNED NULL AFTER `created_by`",
'down' => "ALTER TABLE `reservations` DROP COLUMN `updated_by`",
];
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment