'Init history table and indexes.'

def init_db(self):

    with self.history_lock:
        tablename = self.get_table_name()
        if (not self._db.table_exists(tablename)):
            pk_cols = self.get_primary_key_columns()
            idx_cols = self.get_index_columns()
            self._db.create_table(tablename, self.get_columns(), pk_cols).result()
            self._db.create_index(tablename, idx_cols).result()
