Fix: generate primary key automatically