[DB] Implement code to do setup.

The patch opens a DB connection and create the version management table
if needed.