Migrate db operations

Create tables and indices and update their creation