Add auto generate codes and database