OKAPI (update) cannot handle CREATE TABLE when there is a same table.
andrixnet opened this issue · 2 comments
Discovered while handling this: opencaching/opencaching-pl#2023
Apparently OKAPI database updates cannot handle a CREATE TABLE
statement if the table already exists.
Even though "normal" incremental updates would not encounter such a situation, a create table should be preppend by a DROP TABLE IF EXISTS ...
OKAPI uses consecutive numbering for DB versions. It stores the number of the latest executed DB update in the variable db_version
in table okapi_vars
and will not repeat any update (e.g. a create table
) that was already done.
It looks like your database got corrupted, or that you did manual changes to okapi_
tables. okapi_ tables must not be created or altered manually, they are only maintained via the okapi/update script.
We could implement workarounds for this in OKAPI, which would need extensive changes to the update system. But your OKAPI database then may still be corrupted. Suggested solutions:
-
Restore your database from the last backup with consistent contents, and then run http://my.site/okapi/update.
-
Completely delete the OKAPI database and rebuild it. This means deleting all
okapi_
tables and theokapi_syncbase
field in tablescaches
andcache_logs
; then run http://my.site/okapi/update. All registered consumers and apps will get lost and need to re-register at your site.
Understood.