mirror of
https://github.com/block/buzz.git
synced 2026-10-28 13:01:10 +00:00
Co-authored-by: Codex <codex@openai.com> Signed-off-by: jm <jm@squareup.com> Co-authored-by: Codex <noreply@openai.com>
12 lines
492 B
PL/PgSQL
12 lines
492 B
PL/PgSQL
-- Same advisory coordinate historically named buzz_channel_membership. Policy
|
|
-- generation subsumes that serialization boundary so old and new writers
|
|
-- contend on one key during rolling migration.
|
|
CREATE FUNCTION channel_policy_lock_key(target_community UUID, target_channel UUID)
|
|
RETURNS BIGINT
|
|
LANGUAGE SQL IMMUTABLE STRICT PARALLEL SAFE AS $$
|
|
SELECT hashtextextended(
|
|
'buzz_channel_membership:' || target_community::text || ':' || target_channel::text,
|
|
0
|
|
)
|
|
$$;
|