Skip to content

Commit 137a1c3

Browse files
committed
fix: resolve ambiguous column reference in get_user_storage_quota
The function was failing when no user_storage_quotas record existed because the column names in the SELECT conflicted with the variable names. Added table alias 'st' to disambiguate.
1 parent fc558c2 commit 137a1c3

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

drizzle/storage-bucket.sql

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,10 @@ BEGIN
8585

8686
-- If no record, use default tier
8787
IF v_quota_bytes IS NULL THEN
88-
SELECT quota_bytes, name, slug
88+
SELECT st.quota_bytes, st.name, st.slug
8989
INTO v_quota_bytes, v_tier_name, v_tier_slug
90-
FROM public.storage_tiers
91-
WHERE is_default = TRUE;
90+
FROM public.storage_tiers st
91+
WHERE st.is_default = TRUE;
9292
END IF;
9393

9494
-- Return result

0 commit comments

Comments
 (0)