-- Add source_account_sequence column to reward_ledger_entries
-- This stores the account sequence of the user who triggered the reward (the planter)

ALTER TABLE "reward_ledger_entries" ADD COLUMN "source_account_sequence" VARCHAR(20);

-- Create index for source_account_sequence
CREATE INDEX "idx_source_account_seq" ON "reward_ledger_entries"("source_account_sequence");

-- Note: This column is nullable for backward compatibility with existing records
-- New records should always have this field populated
