Fixing analytics database creation

   - Ensuring that analytics database creation commands are executed in sequence.
   - Refactoring analytics and sync database creation using
executeSqlCommandsInSequence method.