This assumes that all databases call CreateViews/Triggers/Indicies on UpdateOldVersion.  This is not the case currently.

I don't mind if we want to do this - it keeps everything consistent and is more resilient, but to ensure it's always done the calls to CreateViews/Triggers/Indicies needs to be done from CDatabase.

My suggestion is to place the functions Create and UpdateOldVersion in the base class only.  These then call pure-virtual functions CreateTables(), UpdateTables(int version), CreateAnalytics() that perform the table creation and updating, and views/indices/triggers.

That way we guarantee that things are called when they should be.