Skip to content

Conversation

@youngkidwarrior
Copy link
Collaborator

DB: live active distribution shares + privileges

Why:
Transition distribution share computation to real-time, DB-only.
Adds compute_active_distribution_shares() and two views:

  • public.active_distribution_shares
  • public.user_active_distribution_share
    Also sets ownership and GRANTs so clients can read these views.

Test plan:

  • yarn workspace @my/supabase reset # verify migrations apply cleanly
  • yarn workspace @my/supabase generate # update types
  • SELECT * FROM public.active_distribution_shares LIMIT 1; # should run
  • SELECT * FROM public.user_active_distribution_share LIMIT 1; # should run for authed user

DB: drop drift migration file changes.sql

Why:
The diff tool created a transient migration (20251006121127_changes.sql)
introducing send_token_transfers_update_token_balances(), which is not in
our declarative schema and conflicts with the Temporal-driven writes.
Keeping it would cause confusion and divergence.

Test plan:

  • yarn workspace @my/supabase reset (clean apply with no drift)
  • yarn supabase migration:diff changes (no unintended changes appear)

Why:
Transition distribution share computation to real-time, DB-only.
Adds compute_active_distribution_shares() and two views:
- public.active_distribution_shares
- public.user_active_distribution_share
Also sets ownership and GRANTs so clients can read these views.

Test plan:
- yarn workspace @my/supabase reset  # verify migrations apply cleanly
- yarn workspace @my/supabase generate  # update types
- SELECT * FROM public.active_distribution_shares LIMIT 1;  # should run
- SELECT * FROM public.user_active_distribution_share LIMIT 1;  # should run for authed user
Why:
The diff tool created a transient migration (20251006121127_changes.sql)
introducing send_token_transfers_update_token_balances(), which is not in
our declarative schema and conflicts with the Temporal-driven writes.
Keeping it would cause confusion and divergence.

Test plan:
- yarn workspace @my/supabase reset (clean apply with no drift)
- yarn supabase migration:diff changes (no unintended changes appear)
Copy link
Collaborator Author

youngkidwarrior commented Oct 10, 2025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants