OKAPI database definitions and settings

This commit is contained in:
following 2012-08-21 21:30:11 +02:00
parent f118da11e8
commit 2c2d15addd
14 changed files with 118 additions and 14 deletions

25
.gitignore vendored
View File

@ -1,21 +1,24 @@
# Commonly ignored files list. For locally ignored files (e.g. local IDE
# settings), use .git/info/exclude file. Keep the lines in this file sorted.
/lib/htmlpurifier-4.2.0/library/HTMLPurifier/DefinitionCache/Serializer/CSS/*
/lib/htmlpurifier-4.2.0/library/HTMLPurifier/DefinitionCache/Serializer/HTML/*
/lib/htmlpurifier-4.2.0/library/HTMLPurifier/DefinitionCache/Serializer/URI/*
/htdocs/cache/*
/htdocs/cache2/*
# settings files
/htdocs/config2/settings.inc.php
/htdocs/download/*
/htdocs/images/statpics/*
/htdocs/images/uploads/*
/htdocs/lib/settings.inc.php
/htdocs/resource2/tinymce/tiny_mce_*.gz
/htdocs/util-local/ocxml11client/data-files
/htdocs/util-local/ocxml11client/tmp
/htdocs/util/mysql_root/settings.inc.php
/htdocs/util/notification/settings.inc.php
/htdocs/util/publish_caches/settings.inc.php
/htdocs/util/watchlist/settings.inc.php
# other data
/htdocs/cache/*
/htdocs/cache2/*
/htdocs/download/*
/htdocs/images/statpics/*
/htdocs/images/uploads/*
/htdocs/resource2/tinymce/tiny_mce_*.gz
/htdocs/util-local/ocxml11client/data-files
/htdocs/util-local/ocxml11client/tmp
/htdocs/var/*
/lib/htmlpurifier-4.2.0/library/HTMLPurifier/DefinitionCache/Serializer/CSS/*
/lib/htmlpurifier-4.2.0/library/HTMLPurifier/DefinitionCache/Serializer/HTML/*
/lib/htmlpurifier-4.2.0/library/HTMLPurifier/DefinitionCache/Serializer/URI/*

View File

@ -8,3 +8,10 @@ date commit ID change
2012-08-06 1ba2be52 changed triggers sysTransBeforeInsert and sysTransTextBeforeInsert
2012-08-07 eda58c51 new field caches.is_publishdate; changed trigger cachesBeforeUpdate
2012-08-08 fc481334 changed trigger cachesBeforeInsert
2012-08-18 56b80e02 OKAPI will do these changes AUTOMATICALLY upon installation:
- add okapi_* tables
- add caches.okapi_syncbase, initialize it and add corresponding index
- change cache_logs.last_modified and cache_logs_archived.last_modified
field type from 'datetime' to 'timestamp'
See installation instructions at http://code.google.com/p/opencaching-api

View File

@ -0,0 +1,8 @@
SET NAMES 'utf8';
DROP TABLE IF EXISTS `okapi_authorizations`;
CREATE TABLE `okapi_authorizations` (
`consumer_key` varchar(20) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
`user_id` int(11) NOT NULL,
`last_access_token` datetime DEFAULT NULL,
PRIMARY KEY (`consumer_key`,`user_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ;

View File

@ -0,0 +1,8 @@
SET NAMES 'utf8';
DROP TABLE IF EXISTS `okapi_cache`;
CREATE TABLE `okapi_cache` (
`key` varchar(64) NOT NULL,
`value` mediumblob,
`expires` datetime DEFAULT NULL,
PRIMARY KEY (`key`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ;

View File

@ -0,0 +1,8 @@
SET NAMES 'utf8';
DROP TABLE IF EXISTS `okapi_cache_logs`;
CREATE TABLE `okapi_cache_logs` (
`log_id` int(11) NOT NULL,
`consumer_key` varchar(20) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
PRIMARY KEY (`log_id`),
KEY `by_consumer` (`consumer_key`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ;

View File

@ -0,0 +1,7 @@
SET NAMES 'utf8';
DROP TABLE IF EXISTS `okapi_clog`;
CREATE TABLE `okapi_clog` (
`id` int(10) NOT NULL AUTO_INCREMENT,
`data` mediumblob,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ;

View File

@ -0,0 +1,11 @@
SET NAMES 'utf8';
DROP TABLE IF EXISTS `okapi_consumers`;
CREATE TABLE `okapi_consumers` (
`key` varchar(20) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
`name` varchar(100) NOT NULL,
`secret` varchar(40) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
`url` varchar(250) DEFAULT NULL,
`email` varchar(70) DEFAULT NULL,
`date_created` datetime NOT NULL,
PRIMARY KEY (`key`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ;

View File

@ -0,0 +1,8 @@
SET NAMES 'utf8';
DROP TABLE IF EXISTS `okapi_nonces`;
CREATE TABLE `okapi_nonces` (
`consumer_key` varchar(20) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
`key` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
`timestamp` int(10) NOT NULL,
PRIMARY KEY (`consumer_key`,`key`,`timestamp`)
) ENGINE=MEMORY DEFAULT CHARSET=utf8 ;

View File

@ -0,0 +1,13 @@
SET NAMES 'utf8';
DROP TABLE IF EXISTS `okapi_stats_hourly`;
CREATE TABLE `okapi_stats_hourly` (
`consumer_key` varchar(32) NOT NULL,
`user_id` int(10) NOT NULL,
`period_start` datetime NOT NULL,
`service_name` varchar(80) NOT NULL,
`total_calls` int(10) NOT NULL,
`http_calls` int(10) NOT NULL,
`total_runtime` float NOT NULL DEFAULT '0',
`http_runtime` float NOT NULL DEFAULT '0',
PRIMARY KEY (`consumer_key`,`user_id`,`period_start`,`service_name`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ;

View File

@ -0,0 +1,10 @@
SET NAMES 'utf8';
DROP TABLE IF EXISTS `okapi_stats_temp`;
CREATE TABLE `okapi_stats_temp` (
`datetime` datetime NOT NULL,
`consumer_key` varchar(32) NOT NULL DEFAULT 'internal',
`user_id` int(10) NOT NULL DEFAULT '-1',
`service_name` varchar(80) NOT NULL,
`calltype` enum('internal','http') NOT NULL,
`runtime` float NOT NULL DEFAULT '0'
) ENGINE=MEMORY DEFAULT CHARSET=utf8 ;

View File

@ -0,0 +1,14 @@
SET NAMES 'utf8';
DROP TABLE IF EXISTS `okapi_tokens`;
CREATE TABLE `okapi_tokens` (
`key` varchar(20) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
`secret` varchar(40) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
`token_type` enum('request','access') NOT NULL,
`timestamp` int(10) NOT NULL,
`user_id` int(10) DEFAULT NULL,
`consumer_key` varchar(20) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
`verifier` varchar(10) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
`callback` varchar(2083) DEFAULT NULL,
PRIMARY KEY (`key`),
KEY `by_consumer` (`consumer_key`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ;

View File

@ -0,0 +1,7 @@
SET NAMES 'utf8';
DROP TABLE IF EXISTS `okapi_vars`;
CREATE TABLE `okapi_vars` (
`var` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
`value` text,
PRIMARY KEY (`var`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ;

View File

@ -61,7 +61,7 @@
$absolute_server_URI = $dev_baseurl . '/';
// EMail address of the sender
if (!isset($emailaddr)) $emailaddr = 'contact@mail.opencaching.de';
if (!isset($emailaddr)) $emailaddr = 'noreply@opencaching.de';
// location of cache images
if (!isset($picdir)) $picdir = $rootpath . 'images/uploads';
@ -235,7 +235,7 @@
$OKAPI_SETTINGS = array(
'OC_BRANCH' => 'oc.de',
'SITELANG' => 'de',
'VAR_DIR' => $opt['rootpath'].'var',
'VAR_DIR' => $rootpath.'var',
);
?>

View File

@ -301,7 +301,7 @@ function post_config()
$OKAPI_SETTINGS = array(
'OC_BRANCH' => 'oc.de',
'SITELANG' => 'de',
'VAR_DIR' => $opt['rootpath'].'var',
'VAR_DIR' => $rootpath.'var',
);
?>