dbstructure: Delete indexes before the database structure is changed

We had the problem that a change in the database structure caused a database error.

Now the indexes are deleted before the structure is changed.