supabase / stripe-sync-engine

Sync your Stripe account to you Postgres database.

Home Page:https://supabase.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Upserts should deal with missing relationships

kiwicopple opened this issue · comments

Chore

Describe the chore

  • the schema has a relationships between tables
  • if we try to upsert data which is missing foreign data then the upsert will fail (i.e. we might be backfilling the data while a webhook is called)
  • when we are upserting records, we should check that the related data exists first
  • if it doesnt exist, fetch it from Stripe and upsert it