structure.sql ordering, json data id dupe fix