Fix SQLite double primary key issues.
Merge branch 'fix-sqlite-primary-keys'