6.0.0-beta1
7/5/25

[#12234] Horde_cache DB schema
Summary Horde_cache DB schema
Queue Horde Framework Packages
Queue Version Git master
Type Bug
State Not A Bug
Priority 1. Low
Owners
Requester klaus (at) tachtler (dot) net
Created 05/02/2013 (4447 days ago)
Due
Updated 05/07/2013 (4442 days ago)
Assigned
Resolved 05/03/2013 (4446 days ago)
Github Issue Link
Github Pull Request
Milestone
Patch No

History
05/07/2013 08:13:52 AM Ralf Lang Comment #13 Reply to this comment

[Show Quoted Text - 9 lines]
Create a 2nd db, change horde config to use that db (or use a shadow 
horde) and run migrations from scratch. Compare.

At least I don't know any better.
05/07/2013 08:11:38 AM klaus (at) tachtler (dot) net Comment #12 Reply to this comment
Hi Ralf,
horde-db-migrate horde_cache down
horde-db-migrate horde_cache up
thank you, now the changes are made, I did

# horde-db-migrate horde_cache 1
and after that
# horde-db-migrate horde_cache 2

Now, the TABLES are changed to "LONGBLOB" at chace_data!

Thank you.

p.s. How can I find out, if I had "lost" some DB updates at other tables?

Klaus.
05/07/2013 08:06:55 AM Ralf Lang Comment #11 Reply to this comment
First do backups!

You had a typo (horce)

Regenerate the schema from scratch:

horde-db-migrate horde_cache down
horde-db-migrate horde_cache up
05/07/2013 08:04:34 AM klaus (at) tachtler (dot) net Comment #10 Reply to this comment
Hi Jan,
Well, my fault is that for this to work it requires a newer version
of Horde_Db that I didn't manage to release yet (will do so later
today).
following packages were updated today:

Channel        Package              Local          Remote         Size
pear.horde.org Horde_Crypt          2.1.3 (stable) 2.2.0 (stable) 142kB
pear.horde.org Horde_Date           2.0.4 (stable) 2.0.5 (stable) 58kB
pear.horde.org Horde_Db             2.0.2 (stable) 2.0.3 (stable) 105kB
pear.horde.org Horde_Icalendar      2.0.4 (stable) 2.0.5 (stable) 98kB
pear.horde.org Horde_Lock           2.0.2 (stable) 2.1.0 (stable) 17.0kB
pear.horde.org Horde_Prefs          2.3.2 (stable) 2.4.0 (stable) 52kB
pear.horde.org Horde_Rpc            2.0.3 (stable) 2.0.4 (stable) 39kB
pear.horde.org Horde_SessionHandler 2.0.2 (stable) 2.1.0 (stable) 23kB
pear.horde.org Horde_Test           2.2.1 (stable) 2.2.2 (stable) 21kB
pear.horde.org Horde_Text_Filter    2.1.0 (stable) 2.1.1 (stable) 52kB
pear.horde.org Horde_Timezone       1.0.2 (stable) 1.0.3 (stable) 19.7kB
pear.horde.org Horde_Token          2.0.3 (stable) 2.0.4 (stable) 30kB
pear.horde.org Horde_Util           2.2.1 (stable) 2.2.2 (stable) 33kB
pear.horde.org Horde_Vfs            2.0.4 (stable) 2.1.0 (stable) 72kB

BUT, the horde_cache Table look always like this:

CREATE TABLE IF NOT EXISTS `horde_cache` (
    `cache_id` varchar(32) NOT NULL,
    `cache_timestamp` bigint(20) NOT NULL,
    `cache_expiration` bigint(20) NOT NULL,
    `cache_data` blob,
    PRIMARY KEY (`cache_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

After doing horde-db-migrate horce_cache 2, nothing changes?

# horde-db-migrate horde_cache 2
[  INFO  ] Migrating DB to schema version 2.
[  INFO  ] Current horde_cache schema version: 2
[  INFO  ] Ending horde_cache schema version: 2

Thank you,
Klaus.
05/03/2013 10:37:12 AM klaus (at) tachtler (dot) net Comment #9 Reply to this comment
Hi Jan,
What's my fault?
Well, my fault is that for this to work it requires a newer version 
of Horde_Db that I didn't manage to release yet (will do so later 
today).
But your fault is that you installed Horde_Cache even though the 
minimum requirement of Horde_Db wasn't met, which means you must 
have force-installed it.
I would say, you did a really, really good job with the Horde project 
- it was ONLY my fault to force the installation of horde_cache in 
that version!

Thank you for the time to explan the facts to me!

Klaus.
05/03/2013 10:21:47 AM Jan Schneider Comment #8 Reply to this comment
What's my fault?
Well, my fault is that for this to work it requires a newer version of 
Horde_Db that I didn't manage to release yet (will do so later today).
But your fault is that you installed Horde_Cache even though the 
minimum requirement of Horde_Db wasn't met, which means you must have 
force-installed it.
05/03/2013 10:05:26 AM klaus (at) tachtler (dot) net Comment #7 Reply to this comment
Hi Jan,
The error already tells you what to do! Use horde_cache instead of 
Horde_Cache.
Yes, "who can read, has advantages" - so after done it right -->

# horde-db-migrate horde_cache 1
[  INFO  ] Migrating DB to schema version 1.
[  INFO  ] Current horde_cache schema version: 2
Migrating from HordeCacheFixBlobLength (2)
== 2 HordeCacheFixBlobLength: reverting 
=======================================
== 2 HordeCacheFixBlobLength: reverted (0.0000s) 
==============================

Reached target version: 1
[  INFO  ] Ending horde_cache schema version: 1
[root@vml000060 migration]# horde-db-migrate horde_cache
[  INFO  ] Migrating DB up.
[  INFO  ] Current horde_cache schema version: 1
Migrating to HordeCacheFixBlobLength (2)
== 2 HordeCacheFixBlobLength: migrating 
=======================================
-- changeColumn('horde_cache', 'cache_data', 'binary')
    -> 0.4488s
== 2 HordeCacheFixBlobLength: migrated (0.4492s) 
==============================

[  INFO  ] Ending horde_cache schema version: 2
[root@vml000060 migration]# horde-db-migrate horde_cache 2
[  INFO  ] Migrating DB to schema version 2.
[  INFO  ] Current horde_cache schema version: 2
[  INFO  ] Ending horde_cache schema version: 2

But, when I check the structur (with phpMyAdmin), its always this:

--
-- Tabellenstruktur für Tabelle `horde_cache`
--

CREATE TABLE IF NOT EXISTS `horde_cache` (
   `cache_id` varchar(32) NOT NULL,
   `cache_timestamp` bigint(20) NOT NULL,
   `cache_expiration` bigint(20) NOT NULL,
   `cache_data` blob,
   PRIMARY KEY (`cache_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

What's my fault?

Thank you!
Klaus.
05/03/2013 09:31:40 AM Jan Schneider Comment #6 Reply to this comment
The error already tells you what to do! Use horde_cache instead of 
Horde_Cache.
05/03/2013 09:16:20 AM klaus (at) tachtler (dot) net Comment #5 Reply to this comment
Hi Jan,
You can explicitely re-run the 2nd migration step for Horde_Cache though:

$ horde-db-migrate Horde_Cache 1
$ horde-db-migrate Horde_Cache
When is start this from shell, a Fatal Error occurs:


====================

Fatal Error:
Horde_Cache is neither a configured Horde application nor a migration 
directory

Supported applications:

imp
   kronolith
   turba
   nag
   mnemo
   content
   horde_activesync
   horde_alarm
   horde_auth
   horde_cache
   horde_core
   horde_group
   horde_history
   horde_imap_client
   horde_lock
   horde_perms
   horde_prefs
   horde_sessionhandler
   horde_syncml
   horde_token
   horde_vfs

Supported directories:

/var/www/horde5/imp/migration
   /var/www/horde5/kronolith/migration
   /var/www/horde5/turba/migration
   /var/www/horde5/nag/migration
   /var/www/horde5/mnemo/migration
   /var/www/horde5/content/migration
   /usr/share/pear/data/Horde_ActiveSync/migration
   /usr/share/pear/data/Horde_Alarm/migration
   /usr/share/pear/data/Horde_Auth/migration
   /usr/share/pear/data/Horde_Cache/migration
   /usr/share/pear/data/Horde_Core/migration
   /usr/share/pear/data/Horde_Group/migration
   /usr/share/pear/data/Horde_History/migration
   /usr/share/pear/data/Horde_Imap_Client/migration
   /usr/share/pear/data/Horde_Lock/migration
   /usr/share/pear/data/Horde_Perms/migration
   /usr/share/pear/data/Horde_Prefs/migration
   /usr/share/pear/data/Horde_SessionHandler/migration
   /usr/share/pear/data/Horde_SyncMl/migration
   /usr/share/pear/data/Horde_Token/migration
   /usr/share/pear/data/Horde_Vfs/migration

1. Horde_Cli->fatal() /usr/bin/horde-db-migrate:91

====================

Thank you,
Klaus.
05/03/2013 09:12:32 AM Jan Schneider Comment #4 Reply to this comment

[Show Quoted Text - 12 lines]
Well, no scripts that would use a different mechanism than the 
administration page.

You can explicitely re-run the 2nd migration step for Horde_Cache though:

$ horde-db-migrate Horde_Cache 1
$ horde-db-migrate Horde_Cache
05/03/2013 09:04:03 AM klaus (at) tachtler (dot) net Comment #3 Reply to this comment
Hi,
You didn't run all migrations. At least if you refer to BLOB vs. LONGBLOB.
is there a possibility, to check all tables on the database, if there 
are incorrect table structures on the database? Maybe there are other 
tables with similar problems.

Is it possible to correct this by starting some scripts from shell (on 
my linux host), because on the adminstration | configuration site - 
all Database tables ar shown as DB schema ist bereit (is ready/correct)?

Thank you for your reply!
Klaus.
05/03/2013 08:48:41 AM Jan Schneider Comment #2
State ⇒ Not A Bug
Reply to this comment
You didn't run all migrations. At least if you refer to BLOB vs. LONGBLOB.
05/02/2013 10:21:54 PM klaus (at) tachtler (dot) net Comment #1
State ⇒ Unconfirmed
Patch ⇒ No
Milestone ⇒
Queue ⇒ Horde Framework Packages
Summary ⇒ Horde_cache DB schema
Type ⇒ Bug
Priority ⇒ 1. Low
Reply to this comment
Hi,

i installed horde from a long time ago (Horde 4) an upgrade to Horde 5.

After upgrade Horde_cache to Version 2.1.0, i checked the DB schema and the
table horde_cache structure looks like this:

CREATE TABLE IF NOT EXISTS `horde_cache` (
   `cache_id` varchar(32) NOT NULL,
   `cache_timestamp` bigint(20) NOT NULL,
   `cache_expiration` bigint(20) NOT NULL,
   `cache_data` blob,
   PRIMARY KEY (`cache_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

Is that correct? - Or should it be like that:

CREATE TABLE horde_cache (
     cache_id          VARCHAR(32) NOT NULL,
     cache_timestamp   BIGINT NOT NULL,
     cache_data        LONGBLOB,
-- Or, on some DBMS systems:
--  cache_data        IMAGE,

     PRIMARY KEY  (cache_id)
);

I use MySQL (msqli) as backend system for Cache on Horde.

Thank you,
Klaus.

Saved Queries