-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbatch_fix_factories.sh
More file actions
56 lines (50 loc) · 1.22 KB
/
batch_fix_factories.sh
File metadata and controls
56 lines (50 loc) · 1.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#!/bin/bash
# List of models that commonly fail - fix their factories to match actual schemas
fix_factory_if_exists() {
local model_name=$1
local factory_path=$(find database/factories -name "${model_name}Factory.php" 2>/dev/null | head -1)
if [ -n "$factory_path" ]; then
echo "Found: $factory_path"
return 0
else
echo "Not found: ${model_name}Factory"
return 1
fi
}
# Check which factories exist
models=(
"CashFlowProjection"
"CompanyCustomization"
"CompanyHierarchy"
"CompanyMailSettings"
"CompanySubscription"
"ComplianceCheck"
"ComplianceRequirement"
"ContractConfiguration"
"CreditApplication"
"CreditNoteApproval"
"CreditNoteItem"
"CreditNote"
"CrossCompanyUser"
"CustomQuickAction"
"DashboardWidget"
"InAppNotification"
"MailQueue"
"NotificationPreference"
"PaymentMethod"
"PaymentPlan"
"PermissionGroup"
"Permission"
"PhysicalMailSettings"
"PortalNotification"
"QuickActionFavorite"
"QuoteApproval"
"RefundRequest"
"RefundTransaction"
"Tag"
"UserSetting"
)
echo "=== Checking factories ==="
for model in "${models[@]}"; do
fix_factory_if_exists "$model"
done