feat(db): add delegate_party_id column to mpc_sessions table
Add delegate_party_id column to track which party is acting as delegate (generates and returns user share instead of storing it). Changes: - Add delegate_party_id VARCHAR(255) column with default empty string - Add partial index for faster lookups when delegate party is present - Include up and down migrations This fixes the issue where delegate party selection worked but the delegate_party field was not being returned in API responses due to missing database column. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
36e1359f43
commit
391448063f
|
|
@ -0,0 +1,3 @@
|
|||
-- Remove delegate_party_id column from mpc_sessions table
|
||||
DROP INDEX IF EXISTS idx_mpc_sessions_delegate_party;
|
||||
ALTER TABLE mpc_sessions DROP COLUMN IF EXISTS delegate_party_id;
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
-- Add delegate_party_id column to mpc_sessions table
|
||||
-- This column stores the ID of the delegate party that will return user's share
|
||||
-- Only populated for keygen sessions with require_delegate=true
|
||||
ALTER TABLE mpc_sessions ADD COLUMN delegate_party_id VARCHAR(255) DEFAULT '';
|
||||
|
||||
-- Add index for faster lookups by delegate party
|
||||
CREATE INDEX idx_mpc_sessions_delegate_party ON mpc_sessions(delegate_party_id) WHERE delegate_party_id != '';
|
||||
|
||||
-- Add comment
|
||||
COMMENT ON COLUMN mpc_sessions.delegate_party_id IS 'The delegate party ID that generates and returns user share (for keygen sessions with delegate)';
|
||||
Loading…
Reference in New Issue