Merge pull request #1073 from annando/dbstructure