<?xml version="1.0" encoding="UTF-8"?> 
<?xml-stylesheet href="https://dev.horde.org/themes/horde//default/feed-rss.xsl" type="text/xsl"?> 
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"> 
 <channel> 
  <title>SQL Syntax error or access violation updating Horde_History DB schema</title> 
  <pubDate>Sat, 04 Apr 2026 13:09:23 +0000</pubDate> 
  <link>https://bugs.horde.org/ticket/12498?Horde=b22e66e77f49addd355d625c6b025253</link> 
  <atom:link rel="self" type="application/rss+xml" title="SQL Syntax error or access violation updating Horde_History DB schema" href="https://bugs.horde.org/ticket/12498/rss?Horde=b22e66e77f49addd355d625c6b025253" /> 
  <description>SQL Syntax error or access violation updating Horde_History DB schema</description> 
 
   
   
  <item> 
   <title>Trying to update the Horde_History database schema after pea</title> 
   <description>Trying to update the Horde_History database schema after pear package update, the configuration page displays that the DB schema as outdated for Horde_History but displays the following message when trying to update its schema:

SQLSTATE[42000]: Syntax error or access violation: 1091 Can&#039;t DROP &#039;index_horde_histories_on_history_modseq&#039;; check that column/key exists

Horde database created by H4 about a year ago, reused by H5.1.1 now.</description> 
   <pubDate>Thu, 25 Jul 2013 00:31:34 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/12498#t79575</link> 
  </item> 
   
  <item> 
   <title>My guess is that because of the confusion we created surroun</title> 
   <description>My guess is that because of the confusion we created surrounding the upgrade of the History package you ran the migration before the final correct fix was in place. The migration might have succeeded enough to remove the index but no update the schema version.

Try migrating to version 4 and then back up to 6. If that fails, you can edit the migration files and comment out the $this-&gt;removeIndex() line in the 6 migration.</description> 
   <pubDate>Thu, 25 Jul 2013 03:19:07 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/12498#t79581</link> 
  </item> 
   
  <item> 
   <title>&gt; My guess is that because of the confusion we created surro</title> 
   <description>&gt; My guess is that because of the confusion we created surrounding the 
&gt; upgrade of the History package you ran the migration before the final 
&gt; correct fix was in place. The migration might have succeeded enough 
&gt; to remove the index but no update the schema version.
&gt;
&gt; Try migrating to version 4 and then back up to 6. If that fails, you 
&gt; can edit the migration files and comment out the $this-&gt;removeIndex() 
&gt; line in the 6 migration.

Wher can i find the migration files? With the today update of Horde_History from 2.1.1 to 2.1.5 we have the very same error.
Or can i simply create a index with this name and let the schema upgrade remove it?

</description> 
   <pubDate>Fri, 26 Jul 2013 10:38:27 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/12498#t79614</link> 
  </item> 
   
  <item> 
   <title>&gt;&gt; My guess is that because of the confusion we created surr</title> 
   <description>&gt;&gt; My guess is that because of the confusion we created surrounding the
&gt;&gt; upgrade of the History package you ran the migration before the final
&gt;&gt; correct fix was in place. The migration might have succeeded enough
&gt;&gt; to remove the index but no update the schema version.
&gt;&gt;
&gt;&gt; Try migrating to version 4 and then back up to 6. If that fails, you
&gt;&gt; can edit the migration files and comment out the $this-&gt;removeIndex()
&gt;&gt; line in the 6 migration.
&gt;
&gt; Wher can i find the migration files? With the today update of 
&gt; Horde_History from 2.1.1 to 2.1.5 we have the very same error.
&gt; Or can i simply create a index with this name and let the schema 
&gt; upgrade remove it?

Sure, that&#039;s another (probably simpler) way to go.</description> 
   <pubDate>Fri, 26 Jul 2013 13:23:52 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/12498#t79617</link> 
  </item> 
   
  <item> 
   <title>&gt; Wher can i find the migration files? With the today update</title> 
   <description>&gt; Wher can i find the migration files? With the today update of 
&gt; Horde_History from 2.1.1 to 2.1.5 we have the very same error.
&gt; Or can i simply create a index with this name and let the schema 
&gt; upgrade remove it?

Same problem here:
Migrating to HordeHistoryRemoveCompositeIndex (5)
== 5 HordeHistoryRemoveCompositeIndex: migrating ==============================
-- removeIndex(&#039;horde_histories&#039;, &#039;history_modseq&#039;)
QUERY FAILED: Can&#039;t DROP &#039;index_horde_histories_on_history_modseq&#039;; check that column/key exists

DROP INDEX `index_horde_histories_on_history_modseq` ON `horde_histories`
</description> 
   <pubDate>Fri, 26 Jul 2013 14:48:39 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/12498#t79619</link> 
  </item> 
   
  <item> 
   <title>Is my database structure ok?
Can someone give me the right </title> 
   <description>Is my database structure ok?
Can someone give me the right sql command to fix the upgrade?

--
-- Tabellenstruktur für Tabelle `horde_histories`
--

CREATE TABLE IF NOT EXISTS `horde_histories` (
  `history_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `object_uid` varchar(255) NOT NULL,
  `history_action` varchar(32) NOT NULL,
  `history_ts` int(11) NOT NULL,
  `history_desc` longtext,
  `history_who` varchar(255) DEFAULT NULL,
  `history_extra` longtext,
  `history_modseq` int(11) NOT NULL DEFAULT &#039;0&#039;,
  PRIMARY KEY (`history_id`),
  KEY `history_action_idx` (`history_action`),
  KEY `history_ts_idx` (`history_ts`),
  KEY `history_uid_idx` (`object_uid`),
  KEY `index_horde_histories_on_history_modseq_and_object_uid` (`history_modseq`,`object_uid`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=74754 ;</description> 
   <pubDate>Fri, 26 Jul 2013 15:36:23 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/12498#t79620</link> 
  </item> 
   
  <item> 
   <title>I&#039;m beginning to think that the way indexes are named has ch</title> 
   <description>I&#039;m beginning to think that the way indexes are named has changed at some point in the past so that when we generate the name of the index to drop, it doesn&#039;t match the name it was created with in the past.

We probably need to catch the error and try to remove the old name explicitly when this happens.</description> 
   <pubDate>Fri, 26 Jul 2013 16:38:59 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/12498#t79622</link> 
  </item> 
   
  <item> 
   <title>&gt; I&#039;m beginning to think that the way indexes are named has </title> 
   <description>&gt; I&#039;m beginning to think that the way indexes are named has changed at 
&gt; some point in the past so that when we generate the name of the index 
&gt; to drop, it doesn&#039;t match the name it was created with in the past.
&gt;
&gt; We probably need to catch the error and try to remove the old name 
&gt; explicitly when this happens.

OK so I am not a MySQL Guru, can someone recommend a MySQL command to try to fix this?
</description> 
   <pubDate>Fri, 26 Jul 2013 20:20:19 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/12498#t79623</link> 
  </item> 
   
  <item> 
   <title>&gt; OK so I am not a MySQL Guru, can someone recommend a MySQL</title> 
   <description>&gt; OK so I am not a MySQL Guru, can someone recommend a MySQL command to 
&gt; try to fix this?

I fixed it with the following steps:
* horde-db-migrate show Horde_History schema version: 4 and the SQL error.
* comment out the up function in the following files (/usr/share/php/data/Horde_History/migration):
  5_horde_history_remove_compositeindex.php
  6_horde_history_fix_botchedindexes.php
* run horde-db-migrate to update to Horde_History schema version: 6
* I use phpmyadmin to delete all indexes in the horde_histories table except the &quot;PRIMARY key
* at last add the indexes with the following commands
ALTER TABLE `HORDE_DB_NAME`.`horde_histories` ADD INDEX `index_horde_histories_on_history_action` ( `history_action` )
ALTER TABLE `HORDE_DB_NAME`.`horde_histories` ADD INDEX `index_horde_histories_on_history_ts` ( `history_ts` )
ALTER TABLE `HORDE_DB_NAME`.`horde_histories` ADD INDEX `index_horde_histories_on_history_modseq` ( `history_modseq` )
ALTER TABLE `HORDE_DB_NAME`.`horde_histories` ADD INDEX `index_horde_histories_on_object_uid` ( `object_uid` )

I hope this helps.
</description> 
   <pubDate>Sat, 27 Jul 2013 07:41:13 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/12498#t79624</link> 
  </item> 
   
  <item> 
   <title>&gt;&gt; OK so I am not a MySQL Guru, can someone recommend a MySQ</title> 
   <description>&gt;&gt; OK so I am not a MySQL Guru, can someone recommend a MySQL command to
&gt;&gt; try to fix this?
&gt;
&gt; I fixed it with the following steps:
&gt; * horde-db-migrate show Horde_History schema version: 4 and the SQL error.
&gt; * comment out the up function in the following files 
&gt; (/usr/share/php/data/Horde_History/migration):
&gt;   5_horde_history_remove_compositeindex.php
&gt;   6_horde_history_fix_botchedindexes.php
&gt; * run horde-db-migrate to update to Horde_History schema version: 6
&gt; * I use phpmyadmin to delete all indexes in the horde_histories table 
&gt; except the &quot;PRIMARY key
&gt; * at last add the indexes with the following commands
&gt; ALTER TABLE `HORDE_DB_NAME`.`horde_histories` ADD INDEX 
&gt; `index_horde_histories_on_history_action` ( `history_action` )
&gt; ALTER TABLE `HORDE_DB_NAME`.`horde_histories` ADD INDEX 
&gt; `index_horde_histories_on_history_ts` ( `history_ts` )
&gt; ALTER TABLE `HORDE_DB_NAME`.`horde_histories` ADD INDEX 
&gt; `index_horde_histories_on_history_modseq` ( `history_modseq` )
&gt; ALTER TABLE `HORDE_DB_NAME`.`horde_histories` ADD INDEX 
&gt; `index_horde_histories_on_object_uid` ( `object_uid` )
&gt;
&gt; I hope this helps.
&gt;

OK Half of your procedure worked, the SQL part didnt.

I am not sure exactly how to execute these SQL commands ..  I tried in phpmyadmin, going into the horde_db then navigting in horde_histories table then clicking on the SQL (Run SQL Query) and copy paste the commands you provided, I get 

#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near &#039;ALTER TABLE `hordedb`.`horde_histories` ADD INDEX `index_horde_histories_on_hist&#039; at line 2

I tried one by one thinking SQL didnt like the back-to-back with multiple commands in the same query (I know it can do many commands in one query but...)

and I got:

#1072 - Key column &#039;history_ts&#039; doesn&#039;t exist in table

Not sure how to push these commands in SQL.  Can you help ?
Very aprpeciated!</description> 
   <pubDate>Sat, 27 Jul 2013 14:38:34 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/12498#t79627</link> 
  </item> 
   
  <item> 
   <title>&gt; I am not sure exactly how to execute these SQL commands ..</title> 
   <description>&gt; I am not sure exactly how to execute these SQL commands ..  I tried 
&gt; in phpmyadmin, going into the horde_db then navigting in 
&gt; horde_histories table then clicking on the SQL (Run SQL Query) and 
&gt; copy paste the commands you provided, I get

Where are all your columns gone?</description> 
   <pubDate>Sat, 27 Jul 2013 14:50:19 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/12498#t79628</link> 
  </item> 
   
  <item> 
   <title>&gt;&gt; I am not sure exactly how to execute these SQL commands .</title> 
   <description>&gt;&gt; I am not sure exactly how to execute these SQL commands ..  I tried
&gt;&gt; in phpmyadmin, going into the horde_db then navigting in
&gt;&gt; horde_histories table then clicking on the SQL (Run SQL Query) and
&gt;&gt; copy paste the commands you provided, I get
&gt;
&gt; Where are all your columns gone?

Deleted I guess...
 When you said &quot;I use phpmyadmin to delete all indexes in the horde_histories 
table except the &quot;PRIMARY key&quot;  this is what I did, I deleted all columns except the primary key.

I guess I confused indexes and columns...

Can I just recreate the columns and then run your commands? I am afraid to keep screwing around with that, since I dont know what Im doing...</description> 
   <pubDate>Sat, 27 Jul 2013 16:57:07 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/12498#t79630</link> 
  </item> 
   
  <item> 
   <title>&gt; Deleted I guess...

In this case you need the backup of </title> 
   <description>&gt; Deleted I guess...

In this case you need the backup of your database.

&gt;  When you said &quot;I use phpmyadmin to delete all indexes in the horde_histories
&gt; table except the &quot;PRIMARY key&quot;  this is what I did, I deleted all 
&gt; columns except the primary key.

Yes I said delete indexes *not* columns.
I do not know what is to do now.</description> 
   <pubDate>Sat, 27 Jul 2013 19:06:14 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/12498#t79631</link> 
  </item> 
   
  <item> 
   <title>Changes have been made in Git (master):

commit 0e4a486e140a</title> 
   <description>Changes have been made in Git (master):

commit 0e4a486e140a43a63adc9b9357b0f0c0a7d80283
Author: Michael J Rubinsky &lt;mrubinsk@horde.org&gt;
Date:   Fri Aug 2 17:02:31 2013 -0400

    Only remove index if we have the current index name.
    
    Bug: 12498

 .../History/4_horde_history_add_compositeindex.php |   14 +++++++++++-
 .../5_horde_history_remove_compositeindex.php      |   14 +++++++++++-
 .../History/6_horde_history_fix_botchedindexes.php |   21 +++++++++++++++++--
 3 files changed, 42 insertions(+), 7 deletions(-)

http://git.horde.org/horde-git/-/commit/0e4a486e140a43a63adc9b9357b0f0c0a7d80283</description> 
   <pubDate>Fri, 02 Aug 2013 21:03:54 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/12498#t79738</link> 
  </item> 
   
  <item> 
   <title>Hopefully the last of the issues surrounding the latest Hist</title> 
   <description>Hopefully the last of the issues surrounding the latest History updates.</description> 
   <pubDate>Fri, 02 Aug 2013 21:07:04 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/12498#t79739</link> 
  </item> 
   
  <item> 
   <title>&gt; Is my database structure ok?
&gt; Can someone give me the ri</title> 
   <description>&gt; Is my database structure ok?
&gt; Can someone give me the right sql command to fix the upgrade?
&gt;
&gt; --
&gt; -- Tabellenstruktur für Tabelle `horde_histories`
&gt; --
&gt;
&gt; CREATE TABLE IF NOT EXISTS `horde_histories` (
&gt;   `history_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
&gt;   `object_uid` varchar(255) NOT NULL,
&gt;   `history_action` varchar(32) NOT NULL,
&gt;   `history_ts` int(11) NOT NULL,
&gt;   `history_desc` longtext,
&gt;   `history_who` varchar(255) DEFAULT NULL,
&gt;   `history_extra` longtext,
&gt;   `history_modseq` int(11) NOT NULL DEFAULT &#039;0&#039;,
&gt;   PRIMARY KEY (`history_id`),
&gt;   KEY `history_action_idx` (`history_action`),
&gt;   KEY `history_ts_idx` (`history_ts`),
&gt;   KEY `history_uid_idx` (`object_uid`),
&gt;   KEY `index_horde_histories_on_history_modseq_and_object_uid` 
&gt; (`history_modseq`,`object_uid`)
&gt; ) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=74754 ;
</description> 
   <pubDate>Sat, 30 Dec 2023 21:37:01 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/12498#t94175</link> 
  </item> 
   
  <item> 
   <title>&gt;&gt; Is my database structure ok?
&gt;&gt; Can someone give me the </title> 
   <description>&gt;&gt; Is my database structure ok?
&gt;&gt; Can someone give me the right sql command to fix the upgrade?

Moin!
I use this: 

/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `horde_histories` (
  `history_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `object_uid` varchar(255) NOT NULL,
  `history_action` varchar(32) NOT NULL,
  `history_ts` bigint(20) NOT NULL,
  `history_desc` text DEFAULT NULL,
  `history_who` varchar(255) DEFAULT NULL,
  `history_extra` text DEFAULT NULL,
  `history_modseq` int(11) NOT NULL DEFAULT 0,
  PRIMARY KEY (`history_id`),
  KEY `history_action_idx` (`history_action`),
  KEY `history_ts_idx` (`history_ts`),
  KEY `history_uid_idx` (`object_uid`),
  KEY `index_horde_histories_on_history_modseq` (`history_modseq`),
  KEY `index_horde_histories_on_object_uid` (`object_uid`),
  KEY `history_modseq_idx` (`history_modseq`)
) ENGINE=MyISAM AUTO_INCREMENT=14715533 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

:-)
Arnold 
</description> 
   <pubDate>Tue, 02 Jan 2024 12:50:44 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/12498#t94176</link> 
  </item> 
   
   
 
 </channel> 
</rss> 
