Adjusted table and index creation for SQLite
Fixed prefix generation