Delete old database entries after table creation, fix database test