code: def reset_db():
      
      logger = get_logger(PROCESS_SCHEDULER)
      logger.info('Starting *scheduler* DB reset')
  
      ds = ds_manager.ds_factory(logger)
      ds._db_client.drop_database(settings.settings['mongo_db_name'])
      logger.info('*scheduler* db has been dropped')
  
      connection = ds.connection(COLLECTION_MANAGED_PROCESS)
      connection.create_index([(PROCESS_NAME, pymongo.ASCENDING)], unique=True)
  
      connection = ds.connection(COLLECTION_FREERUN_PROCESS)
      connection.create_index([(PROCESS_NAME, pymongo.ASCENDING), (ENTRY_NAME, pymongo.ASCENDING)], unique=True)
  
      connection = ds.connection(COLLECTION_UNIT_OF_WORK)
      connection.create_index([(PROCESS_NAME, pymongo.ASCENDING),
                               (TIMEPERIOD, pymongo.ASCENDING),
                               (START_ID, pymongo.ASCENDING),
                               (END_ID, pymongo.ASCENDING)], unique=True)
  
      connection = ds.connection(COLLECTION_LOG_RECORDING)
      connection.create_index([(PARENT_OBJECT_ID, pymongo.ASCENDING)], unique=True)
  
      # expireAfterSeconds: <int> Used to create an expiring (TTL) collection.
      # MongoDB will automatically delete documents from this collection after <int> seconds.
      # The indexed field must be a UTC datetime or the data will not expire.
      ttl_seconds = settings.settings['db_log_ttl_days'] * 86400     # number of seconds for TTL
      connection.create_index(CREATED_AT, expireAfterSeconds=ttl_seconds)
  
      for collection_name in [COLLECTION_JOB_HOURLY, COLLECTION_JOB_DAILY,
                              COLLECTION_JOB_MONTHLY, COLLECTION_JOB_YEARLY]:
          connection = ds.connection(collection_name)
          connection.create_index([(PROCESS_NAME, pymongo.ASCENDING), (TIMEPERIOD, pymongo.ASCENDING)], unique=True)
  
      # reset Synergy Flow tables
      db_manager.reset_db()
      logger.info('*scheduler* db has been recreated')
docs: drops the *scheduler* database, resets schema