fix SQLite variant of metadata scripts