Fix category metadata
fix SQLite metadata scripts to not use variable prefix, and also reflect MySQL scripts.