P0 Migration: Move fake orgs to ServiceProvider + cleanup #294

Open
opened 2026-06-25 03:42:01 +02:00 by kincses · 1 comment
Owner

Mérföldkő: P0 Architecture Refactor (Option C - Hybrid)
Cél: Meglévő fake Organization rekordok áttelepítése marketplace.service_providers táblába

Függőségek (Dependencies)

  • Bemenet: Schema changes (#292), Refactored quick_add_provider (#293)
  • Kimenet: Tiszta fleet.organizations tábla, pontos admin garázslista

Elemzés

  1. Új fájl: backend/scripts/migrate_providers.py
  2. Safe list (megtartandó org ID-k): 15, 21, 43, 45, 47, 48, 49, 50, 66, 67, 69, 70, 71
  3. SELECT all orgs where id NOT IN safe list
  4. Minden fake org-hoz:
    • INSERT into marketplace.service_providers (name, address, city, etc.)
    • UPDATE marketplace.service_profiles SET service_provider_id = new_id WHERE organization_id = fake_org_id
    • UPDATE fleet_finance.asset_costs SET service_provider_id = new_id WHERE vendor_organization_id = fake_org_id
  5. DELETE cascade:
    • DELETE from fleet.branches WHERE organization_id IN (fake org IDs)
    • DELETE from fleet.organization_members WHERE organization_id IN (fake org IDs)
    • DELETE from fleet.organizations WHERE id IN (fake org IDs)
  6. Futtatás: docker exec sf_api python3 /scripts/migrate_providers.py
**Mérföldkő:** P0 Architecture Refactor (Option C - Hybrid) **Cél:** Meglévő fake Organization rekordok áttelepítése marketplace.service_providers táblába ### Függőségek (Dependencies) - **Bemenet:** Schema changes (#292), Refactored quick_add_provider (#293) - **Kimenet:** Tiszta fleet.organizations tábla, pontos admin garázslista ### Elemzés 1. Új fájl: backend/scripts/migrate_providers.py 2. Safe list (megtartandó org ID-k): 15, 21, 43, 45, 47, 48, 49, 50, 66, 67, 69, 70, 71 3. SELECT all orgs where id NOT IN safe list 4. Minden fake org-hoz: - INSERT into marketplace.service_providers (name, address, city, etc.) - UPDATE marketplace.service_profiles SET service_provider_id = new_id WHERE organization_id = fake_org_id - UPDATE fleet_finance.asset_costs SET service_provider_id = new_id WHERE vendor_organization_id = fake_org_id 5. DELETE cascade: - DELETE from fleet.branches WHERE organization_id IN (fake org IDs) - DELETE from fleet.organization_members WHERE organization_id IN (fake org IDs) - DELETE from fleet.organizations WHERE id IN (fake org IDs) 6. Futtatás: docker exec sf_api python3 /scripts/migrate_providers.py
kincses added the Status: To DoType: Script labels 2026-06-25 03:42:01 +02:00
kincses added Status: In Progress and removed Status: To Do labels 2026-06-25 03:42:25 +02:00
kincses started working 2026-06-25 03:42:25 +02:00
Author
Owner

▶️ Munka megkezdve: 2026-06-25 03:42:25

▶️ **Munka megkezdve:** 2026-06-25 03:42:25
kincses worked for 1 second 2026-06-25 03:42:26 +02:00
Sign in to join this conversation.