Commit 4197b68a authored by DevPilot's avatar DevPilot

tools(route_smoke): استخدم صفوف حيّة غير مؤرشفة عشان الشاشة تتفتح فعلاً

parent 41217a9f
......@@ -69,6 +69,36 @@ ID_TABLES = {
'groups': 'sa_groups',
'bookings': 'sa_bookings',
'invoices': 'vendor_invoices',
'academies': 'sa_academies',
'auctions': 'auctions',
'cards': 'sa_player_cards',
'children': 'children',
'coaches': 'sa_coaches',
'death': 'death_cases',
'disciplines': 'sa_disciplines',
'divorce': 'divorce_cases',
'fiscal-years': 'fiscal_years',
'games': 'sa_games',
'institutions': 'sa_institutions',
'instruments': 'negotiable_instruments',
'interviews': 'interviews',
'locker-rentals': 'sa_locker_rentals',
'makeup-sessions': 'sa_makeup_sessions',
'mirror': 'sa_facilities',
'pool-grid': 'sa_facilities',
'programs': 'sa_programs',
'purchase-orders': 'purchase_orders',
'queue': 'payment_requests',
'requisitions': 'purchase_requisitions',
'reservations': 'reservations',
'spouses': 'spouses',
'subscriptions': 'subscriptions',
'support': 'support_tickets',
'temporary': 'temporary_members',
'tournaments': 'tournaments',
'transfers': 'transfer_requests',
'vouchers': 'vouchers',
'waivers': 'waiver_requests',
}
......@@ -98,13 +128,18 @@ def load_real_ids():
out = {}
cur = conn.cursor()
for seg, table in ID_TABLES.items():
try:
cur.execute(f'SELECT MIN(id) FROM `{table}`')
row = cur.fetchone()
if row and row[0]:
out[seg] = int(row[0])
except Exception:
pass
# الصف المؤرشف بيخلي الكنترولر يعمل redirect، فالشاشة ما بتتفتحش —
# لازم نختار صف حي عشان الفحص يبقى ليه معنى.
for sql in (f'SELECT MIN(id) FROM `{table}` WHERE is_archived = 0',
f'SELECT MIN(id) FROM `{table}`'):
try:
cur.execute(sql)
row = cur.fetchone()
if row and row[0]:
out[seg] = int(row[0])
break
except Exception:
continue
conn.close()
return out
......
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