Commit af806c60 authored by Mahmoud Aglan's avatar Mahmoud Aglan

Fix migration and seed failures: correct column references

- Phase_45_004: activity_pricing has no 'fee_type' column, use
  'nonmember_rate_pm' as AFTER target instead
- Seed Phase_52_001: system_config uses 'group_name' not 'category',
  and 'description_ar' not 'description', and needs 'config_type'
Co-Authored-By: 's avatarClaude Opus 4.6 <noreply@anthropic.com>
parent 5c9ce3c8
......@@ -2,6 +2,6 @@
declare(strict_types=1);
return [
'up' => "ALTER TABLE `activity_pricing` ADD COLUMN `group_type` VARCHAR(20) NULL AFTER `fee_type`, ADD COLUMN `service_tier` VARCHAR(20) NULL DEFAULT 'standard' AFTER `group_type`, ADD INDEX `idx_ap_group_tier` (`group_type`, `service_tier`)",
'up' => "ALTER TABLE `activity_pricing` ADD COLUMN `group_type` VARCHAR(20) NULL AFTER `nonmember_rate_pm`, ADD COLUMN `service_tier` VARCHAR(20) NULL DEFAULT 'standard' AFTER `group_type`, ADD INDEX `idx_ap_group_tier` (`group_type`, `service_tier`)",
'down' => "ALTER TABLE `activity_pricing` DROP INDEX `idx_ap_group_tier`, DROP COLUMN `service_tier`, DROP COLUMN `group_type`",
];
......@@ -107,14 +107,14 @@ return function (Database $db): void {
// حفظ في system_config كـ JSON
$configs = [
['config_key' => 'sports_pricing_member', 'config_value' => json_encode($memberPricing, JSON_UNESCAPED_UNICODE), 'category' => 'sports_pricing', 'description' => 'تسعير الملاعب للأعضاء - لائحة 2025'],
['config_key' => 'sports_pricing_non_member', 'config_value' => json_encode($nonMemberPricing, JSON_UNESCAPED_UNICODE), 'category' => 'sports_pricing', 'description' => 'تسعير الملاعب لغير الأعضاء - لائحة 2025'],
['config_key' => 'entry_tickets_non_member', 'config_value' => json_encode($entryTickets, JSON_UNESCAPED_UNICODE), 'category' => 'sports_pricing', 'description' => 'تذاكر الدخول لغير الأعضاء'],
['config_key' => 'general_fees', 'config_value' => json_encode($generalFees, JSON_UNESCAPED_UNICODE), 'category' => 'sports_pricing', 'description' => 'الرسوم العامة - لائحة 2025'],
['config_key' => 'table_rentals', 'config_value' => json_encode($tableRentals, JSON_UNESCAPED_UNICODE), 'category' => 'sports_pricing', 'description' => 'إيجار الطاولات بالنادي'],
['config_key' => 'locker_pricing', 'config_value' => json_encode($lockerPricing, JSON_UNESCAPED_UNICODE), 'category' => 'sports_pricing', 'description' => 'حجز اللوكر'],
['config_key' => 'track_pricing', 'config_value' => json_encode($trackPricing, JSON_UNESCAPED_UNICODE), 'category' => 'sports_pricing', 'description' => 'تراك الدرجات'],
['config_key' => 'pool_institutional', 'config_value' => json_encode($poolInstitutional, JSON_UNESCAPED_UNICODE), 'category' => 'sports_pricing', 'description' => 'رسوم حمام السباحة للمؤسسات'],
['config_key' => 'sports_pricing_member', 'config_value' => json_encode($memberPricing, JSON_UNESCAPED_UNICODE), 'group_name' => 'sports_pricing', 'config_type' => 'json', 'description_ar' => 'تسعير الملاعب للأعضاء - لائحة 2025'],
['config_key' => 'sports_pricing_non_member', 'config_value' => json_encode($nonMemberPricing, JSON_UNESCAPED_UNICODE), 'group_name' => 'sports_pricing', 'config_type' => 'json', 'description_ar' => 'تسعير الملاعب لغير الأعضاء - لائحة 2025'],
['config_key' => 'entry_tickets_non_member', 'config_value' => json_encode($entryTickets, JSON_UNESCAPED_UNICODE), 'group_name' => 'sports_pricing', 'config_type' => 'json', 'description_ar' => 'تذاكر الدخول لغير الأعضاء'],
['config_key' => 'general_fees', 'config_value' => json_encode($generalFees, JSON_UNESCAPED_UNICODE), 'group_name' => 'sports_pricing', 'config_type' => 'json', 'description_ar' => 'الرسوم العامة - لائحة 2025'],
['config_key' => 'table_rentals', 'config_value' => json_encode($tableRentals, JSON_UNESCAPED_UNICODE), 'group_name' => 'sports_pricing', 'config_type' => 'json', 'description_ar' => 'إيجار الطاولات بالنادي'],
['config_key' => 'locker_pricing', 'config_value' => json_encode($lockerPricing, JSON_UNESCAPED_UNICODE), 'group_name' => 'sports_pricing', 'config_type' => 'json', 'description_ar' => 'حجز اللوكر'],
['config_key' => 'track_pricing', 'config_value' => json_encode($trackPricing, JSON_UNESCAPED_UNICODE), 'group_name' => 'sports_pricing', 'config_type' => 'json', 'description_ar' => 'تراك الدرجات'],
['config_key' => 'pool_institutional', 'config_value' => json_encode($poolInstitutional, JSON_UNESCAPED_UNICODE), 'group_name' => 'sports_pricing', 'config_type' => 'json', 'description_ar' => 'رسوم حمام السباحة للمؤسسات'],
];
foreach ($configs as $config) {
......@@ -125,8 +125,8 @@ return function (Database $db): void {
if ($exists) {
$db->update('system_config', [
'config_value' => $config['config_value'],
'description' => $config['description'],
'config_value' => $config['config_value'],
'description_ar' => $config['description_ar'],
], 'config_key = ?', [$config['config_key']]);
} else {
$db->insert('system_config', $config);
......
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