Rewrite code for database, set starting auto increment id at 1