DB: Add console table migration.

Various PEP8 fixes.