fix(db): Supabase name drift alignment — system_configs/linking_codes (PR-SQL-3A)#34
Merged
Merged
Conversation
…s (PR-SQL-3A)
Kodda kullanılan eski tablo adlarını canlı/kanonik adlarla hizalar. YALNIZ kod
düzeltmesi — migration/SQL/şema değişikliği YOK, production'a yazma YOK. İş mantığı
değişmedi (sadece .from() hedefi + kolon paritesi doğrulandı).
Parite doğrulandı → hizalandı:
- system_configs → runtime_policies (superAdminService getSystemPolicies/updatePolicy);
kolonlar id/key/name/value/unit/updated_at canlı runtime_policies'te mevcut.
- linking_codes → vehicle_linking_codes (website vehicle/code API);
insert {vehicle_id, code, expires_at} canlı şemayla birebir uyumlu.
Parite YOK → KAPSAM DIŞI (raporlandı):
- push_subscriptions → vehicle_push_tokens: kod endpoint/subscription/user_id +
onConflict:'endpoint' kullanıyor; canlı tablo fcm_token/platform/vehicle_id (FCM≠Web Push).
Kör rename akışı kırardı → DOKUNULMADI.
- src/__tests__/supabaseNameDrift.test.ts: .from() hedeflerini kilitler (mock) +
eski adların aktif kod yolunda kalmadığını ?raw kaynak-kilidiyle doğrular.
Dokunulmadı: remote_commands · memberships/tenant · radar_reports/raw_community_events ·
sentry_clips (bucket). tsc -b temiz · eslint temiz · 2493 test yeşil (23 bilinen env-gated) ·
production build yeşil.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Fauew13VP3vbfKqnocPdfX
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Amaç
Kodda kullanılan eski Supabase tablo adlarını canlı/kanonik adlarla hizalar. Yalnız kod düzeltmesi — migration/SQL/şema değişikliği yok, production'a yazma yok, iş mantığı değişmedi.
Kolon paritesi sonucu (ön kontrol)
system_configs→runtime_policieslinking_codes→vehicle_linking_codespush_subscriptions→vehicle_push_tokensYapılan isim hizalamaları
superAdminService.ts:getSystemPolicies(read) +updatePolicy(write) →.from('runtime_policies')(eskidensystem_configs)SuperAdminShell.tsx: boş-durum UI metnisystem_configs→runtime_policieswebsite/src/app/api/vehicle/code/route.ts:.from('linking_codes')→.from('vehicle_linking_codes')Kapsam dışı bırakılan öğe
push_subscriptions— kolon paritesi yok. Canlıvehicle_push_tokensbir FCM token tablosu (fcm_token/platform); kod ise Web Push alanları (endpoint/subscription/user_id, onConflict 'endpoint') kullanıyor. Semantik olarak farklı tablolar → dokunulmadı, raporlandı. (Bu ayrı bir değerlendirme gerektirir — web-push tablosu eksik mi yoksa özellik dormant mı.)Değişen dosyalar
src/platform/superadmin/superAdminService.ts·src/components/admin/SuperAdminShell.tsx·website/src/app/api/vehicle/code/route.ts·src/__tests__/supabaseNameDrift.test.ts(yeni)Testler
supabaseNameDrift.test.ts— Supabase.from()hedeflerini açıkça kilitler:getSystemPolicies→runtime_policiesOKUR (system_configsdeğil)updatePolicy→runtime_policiesYAZAR (+ audit_logs akışı korundu)from('system_configs')KALMADI (?raw kaynak-kilit)from('linking_codes')KALMADI,vehicle_linking_codesVARpush_subscriptionssenaryosu N/A — kapsam dışı)Test sonuçları
tsc -b --noEmittemizeslinttemizRisk analizi
Düşük. Şema değişmediği için DB verisi etkilenmez. Kolon paritesi doğrulanan 2 hizalamada field-mapping korundu; iş mantığı/fallback değişmedi. Parite olmayan
push_subscriptionsbilinçli dışarıda → yanlış-mapping runtime kırılması engellendi.Dokunulmayanlar (kural)
remote_commands·memberships/tenant ·radar_reports/raw_community_events·sentry_clips(bucket) · PR #11/#20 · branch silme · merge.Production DB'ye yazılmadığı doğrulaması
PR yalnız TypeScript kod değişikliği + test içerir. Hiçbir migration/SQL/production DB çağrısı yok; canlı şema ve veri değişmedi.
Merge YAPILMADI.
🤖 Generated with Claude Code
https://claude.ai/code/session_01Fauew13VP3vbfKqnocPdfX