Added autoincrementation to tables profile and template