rework db

Change-Id: Id5a2a69cf167b6e830c5b598fd41f9e92aed736e
some changes

Change-Id: Idc660a9f77c06ab4139209c8d1fc5565e3ee5f66