Files
Erupe/server/migrations/sql/0010_fix_zero_rasta_id.sql
Houmgaor 05ea321d9e fix(migrations): heal rasta_id=0 rows (#163)
The pre-106cf85 SaveMercenary bug could overwrite a character's NULL
rasta_id with 0, a value not drawn from rasta_id_seq that causes silent
save failures. The code fix prevents new occurrences but leaves already
affected rows stuck. Migration 0010 sets rasta_id=NULL where it is 0 so
existing users auto-heal on upgrade.
2026-04-06 17:10:33 +02:00

6 lines
355 B
SQL

-- Heal characters whose rasta_id was clobbered to 0 by the pre-106cf85
-- SaveMercenary bug. A rasta_id of 0 is not a valid sequence value and
-- causes silent save failures on affected characters (see #163).
-- The normal default for characters that never registered a mercenary is NULL.
UPDATE public.characters SET rasta_id = NULL WHERE rasta_id = 0;