database: structure update and more test cases