#!/bin/sh

# Build summaries for speeding up interactive interface

.  _PATH_TO_INSTALL_/bin/Definitions

function CreateIndexIfNecessary()
{
   (
      INDX=`FindIndex "$2"`
      if [ "$INDX" = "" ]
      then
         CreateAndRegisterIndex "$@"
      fi
   )
}

echo "Building required database indexes"
CreateIndexIfNecessary "taxdata" "SourceFilename_Btree" "btree" "sourcefilename"
CreateIndexIfNecessary "taxdata" "EndDateTime_Btree" "btree" "EndDateTime"
CreateIndexIfNecessary "taxdata" "Calltype_Btree" "btree" "CallType"
CreateIndexIfNecessary "taxdata" "Users_Btree" "btree" "ChargedUsername" "chargednumber"
CreateIndexIfNecessary "geozones" "GeozonesScan_Btree" "btree" "zone" "match" "lmatch"
CreateIndexIfNecessary "geozones" "GeozonesZones_Btree" "btree" "zone"
CreateIndexIfNecessary "geozones" "GeozonesIdZones_Btree" "btree" "taxdataid" "zone"



