Can you issue the same db command but -f migrations.sql instead?
Also, cut and paste this into BI on alert settings, just in case it's something simple
{"ai_dump":&JSON, "Image":"&ALERT_JPEG", "camera":"&CAM", "ALERT_PATH":"&ALERT_PATH", "ALERT_CLIP":"&ALERT_CLIP", "timestamp":"&ALERT_TIME"}