-- Add signing_parties column to accounts table
-- This column stores configured party IDs for signing operations
-- If NULL or empty, all active parties will be used for signing

ALTER TABLE accounts
ADD COLUMN signing_parties TEXT[];

-- Add index for querying accounts with configured signing parties
CREATE INDEX idx_accounts_signing_parties ON accounts USING GIN(signing_parties) WHERE signing_parties IS NOT NULL;

COMMENT ON COLUMN accounts.signing_parties IS 'Configured party IDs for signing operations. NULL means use all active parties.';
