Fix composite primary key constraint in sqlite

Only add columns specified in primary key constraint rather than all
table columns.