fixed delete order of generate records by remember as flat list and delete actual record before all required records (restrict constraints can only appear on that records)