public function alterTable($tableName, $newFields = null, $newIndexes = null, $alteredFields = null, $alteredIndexes = null, $alteredOptions=null, $advancedOptions=null)
    {
        $alterList = array();

        // drop any fulltext indexes that exist on the table before altering the structure
        if ($this->fulltextIndexExists($tableName)) {
            $alterList[] = "\nDROP FULLTEXT INDEX ON \"$tableName\";";
        }

        if ($newFields) {
            foreach ($newFields as $k => $v) {
                $alterList[] = "ALTER TABLE \"$tableName\" ADD \"$k\" $v";
            }
        }

        if ($alteredFields) {
            foreach ($alteredFields as $k => $v) {
                $alterList[] = $this->alterTableAlterColumn($tableName, $k, $v);
            }
        }
        if ($alteredIndexes) {
            foreach ($alteredIndexes as $k => $v) {
                $alterList[] = $this->getIndexSqlDefinition($tableName, $k, $v);
            }
        }
        if ($newIndexes) {
            foreach ($newIndexes as $k => $v) {
                $alterList[] = $this->getIndexSqlDefinition($tableName, $k, $v);
            }
        }

        if ($alterList) {
            foreach ($alterList as $alteration) {
                if ($alteration != '') {
                    $this->query($alteration);
                }
            }
        }
    }