Refactor db layer to comply with XMS conventions.
[db-layer] Fix typo for postgresql type.