<?php
/**
 * Upgrades the database from version 1.5.1 to version 1.6.0
 * DO NOT call this directly, it will fail.
 * To be included from classes/core/updater.class.php.
 * Assumes that logging has already been init()ed. Log class will throw ServerException if not.
 */

//In importer, if config item does not exist, create it and set it TRUE.
//Warn in update that this has been done.

Log::write(Log::LOGLEVEL_INFO, "In updater, from 1.5.1 to 1.6.0");

Log::write(Log::LOGLEVEL_INFO, "Creating table: apikey");
database::query("CREATE TABLE `apikey` ( 
        `id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT , 
        `keyhash` TEXT NOT NULL , 
        `scope` TEXT NOT NULL , 
        `iplowest` BIGINT UNSIGNED NOT NULL , 
        `iphighest` BIGINT UNSIGNED NOT NULL , 
        PRIMARY KEY (`id`)
    ) ENGINE = InnoDB;
");
Log::write(Log::LOGLEVEL_INFO, "...done");


Log::write(Log::LOGLEVEL_INFO, "...update done");

