add code for automatic generation of primary key