[Owncloud] update tables in database schema

Alessandro Cosentino cosenal at gmail.com
Wed May 30 22:53:23 UTC 2012


Hi,

after a couple of weeks of coding my first owncloud app, everything is
going smooth, except for the problem that I am going to describe and
that bothers me not a little.
Quoting the DB interaction page on the owncloud website [1], "To
update the tables used by the app, simply adjust the database.xml file
and increase the app version number to trigger an update."

This doesn't always work. In fact I find the behaviour of the table
update for an app very unpredictable. Let me give more details:
sometimes I need to change the version more than once before the
update is triggered (I didn't manage to find a rational explanation to
this). Also, I tried to enable/disable the app to trigger a table
update, but that doesn't work.

The last time I updated the table with new fields and new indices, I
got this message whatever owncloud page I try to open:

Fatal error: Using $this when not in object context in
/var/www/owncloud/3rdparty/MDB2/Schema/Parser.php on line 581

The corresponding line in the owncloud log is:
{"app":"core","message":"Failed to get existing database structure for
upgrading (MDB2 Error: unknown error)","level":4,"time":1327955192}

The only way to get rid of this error is renaming the database.xml of
my app, which then will obviously no longer work.
How can I fix this problem? And more generally:
How does the update actually work? When is it triggered?

Important note: I use sqlitebrowser when I want to manually update the
values of some tables.

Thanks,
Alessandro

[1] http://owncloud.org/dev/api-documentation/db-interation/



More information about the Owncloud mailing list