migration: add status query functions