6.0.0-beta1
7/4/25

[#10578] horde-db-migrate doesn't run all scripts
Summary horde-db-migrate doesn't run all scripts
Queue Horde Framework Packages
Queue Version Git master
Type Bug
State Resolved
Priority 2. Medium
Owners jan (at) horde (dot) org
Requester michael (at) bigmichi1 (dot) de
Created 09/29/2011 (5027 days ago)
Due
Updated 10/07/2011 (5019 days ago)
Assigned 10/03/2011 (5023 days ago)
Resolved 10/07/2011 (5019 days ago)
Github Issue Link
Github Pull Request
Milestone
Patch No

History
10/07/2011 07:56:20 PM Jan Schneider Summary ⇒ horde-db-migrate doesn't run all scripts
 
10/07/2011 07:56:04 PM Jan Schneider Version ⇒ Git master
Queue ⇒ Horde Framework Packages
 
10/07/2011 07:55:39 PM Jan Schneider Assigned to Jan Schneider
State ⇒ Resolved
 
10/07/2011 07:55:19 PM Git Commit Comment #8 Reply to this comment
Changes have been made in Git for this ticket:

Add test case for bug #10578.

  1 files changed, 24 insertions(+), 6 deletions(-)
http://git.horde.org/horde-git/-/commit/e4c4e7221ce467e8086b3b238843ffa93ecaaf47
10/07/2011 07:55:14 PM Git Commit Comment #7 Reply to this comment
Changes have been made in Git for this ticket:

[jan] Fix transactions with MySQLi driver (Bug #10578).

  2 files changed, 21 insertions(+), 0 deletions(-)
http://git.horde.org/horde-git/-/commit/5f111731d6bfe79db8d7c5bb30e359842a9a1cbe
10/04/2011 06:58:20 AM michael (at) bigmichi1 (dot) de Comment #6 Reply to this comment
you are right i am using the mysqli extension. after i changed to the 
mysql/pdo extension the upgrade works without problems
10/03/2011 06:03:16 PM Jan Schneider Comment #5 Reply to this comment
Any chance you are using the mysqli backend? There is something badly 
broken with the mysqli extension, I've seen that before with that 
backend.

One of the last statements in the first run:
UPDATE wicked_schema_info SET version = 5
No errors getting back from the server.

And one of the earliest statements in the second run:
SELECT version FROM wicked_schema_info
Current wicked schema version: 4

So the schema version is clearly updated, but the update doesn't 
stick. If it's really the same that I've noticed earlier, then you can 
even enable query logging in mysql and see the very same. The update 
query is sent to server and run without errors. But nothing is changed.
10/03/2011 05:52:43 PM michael (at) bigmichi1 (dot) de Comment #4
New Attachment: migration2.log Download
Reply to this comment
second try for migration with --debug flag,
this is the first time i see such a behaviour
10/03/2011 05:50:37 PM michael (at) bigmichi1 (dot) de Comment #3
New Attachment: migration.log Download
Reply to this comment
first try with no wicked* tables
10/03/2011 05:33:35 PM Jan Schneider Comment #2
State ⇒ Feedback
Reply to this comment
The migration *is* completed, but the schema version isn't updated. 
Did you see this in any migration earlier? Try running with the 
--debug flag, or check the logs when running through the website.
09/29/2011 03:40:04 PM michael (at) bigmichi1 (dot) de Comment #1
Priority ⇒ 2. Medium
State ⇒ Unconfirmed
Patch ⇒ No
Milestone ⇒
Queue ⇒ Wicked
Summary ⇒ horde-db-migrade doesn't run all scripts
Type ⇒ Bug
Reply to this comment
the schema isn't completly created when i try to run horde-db-migrade, 
so the adminscreen says everytime schema not up to date and needs to 
be run. so i deleted all wicked* tables and run horde-db-migrade from 
command line:

root@server:~# /var/www/pear/horde-db-migrate wicked
[  INFO  ] Migrating DB up.
[  INFO  ] Current wicked schema version: 0
Migrating to WickedBaseTables (1)
== 1 WickedBaseTables: migrating 
==============================================
-- tables()
    -> 0.0017s
-- createTable(wicked_pages, array(autoincrementKey => false))
    -> 0.0071s
-- addIndex(wicked_pages, array(0 => 'page_name'), array(unique => true))
    -> 0.1798s
-- createTable(wicked_history, array(autoincrementKey => false))
    -> 0.0000s
-- addIndex(wicked_history, array(0 => 'page_name'))
    -> 0.0332s
-- addIndex(wicked_history, array(0 => 'page_majorversion', 1 => 
'page_minorversion'))
    -> 0.0213s
-- createTable(wicked_attachments, array(autoincrementKey => false))
    -> 0.0000s
-- createTable(wicked_attachment_history, array(autoincrementKey => false))
    -> 0.0000s
-- addIndex(wicked_attachment_history, array(0 => 
'attachment_majorversion', 1 => 'attachment_minorversion'))
    -> 0.0174s
== 1 WickedBaseTables: migrated (0.4735s) 
=====================================

Migrating to WickedAutoIncrementPageId (2)
== 2 WickedAutoIncrementPageId: migrating 
=====================================
-- changeColumn(wicked_pages, page_id, autoincrementKey)
    -> 0.0355s
-- dropTable(wicked_pages_seq)
== 2 WickedAutoIncrementPageId: migrated (0.0848s) 
============================

Migrating to WickedUnsignedInts (3)
== 3 WickedUnsignedInts: migrating 
============================================
-- changeColumn(wicked_pages, page_id, integer, array(autoincrement => 
true, null => false, unsigned => true))
    -> 0.0082s
-- changeColumn(wicked_pages, page_hits, integer, array(default => 0, 
unsigned => true))
    -> 0.0154s
-- changeColumn(wicked_pages, page_majorversion, integer, array(null 
=> false, unsigned => true))
    -> 0.0233s
-- changeColumn(wicked_pages, page_minorversion, integer, array(null 
=> false, unsigned => true))
    -> 0.0162s
-- changeColumn(wicked_pages, version_created, integer, array(null => 
false, unsigned => true))
    -> 0.0195s
-- changeColumn(wicked_history, page_id, integer, array(null => false, 
unsigned => true))
    -> 0.0199s
-- changeColumn(wicked_history, page_majorversion, integer, array(null 
=> false, unsigned => true))
    -> 0.0144s
-- changeColumn(wicked_history, page_minorversion, integer, array(null 
=> false, unsigned => true))
    -> 0.0169s
-- changeColumn(wicked_history, version_created, integer, array(null 
=> false, unsigned => true))
    -> 0.0153s
-- changeColumn(wicked_attachments, page_id, integer, array(null => 
false, unsigned => true))
    -> 0.0196s
-- changeColumn(wicked_attachments, attachment_hits, integer, 
array(default => 0, unsigned => true))
    -> 0.0137s
-- changeColumn(wicked_attachments, attachment_majorversion, integer, 
array(null => false, unsigned => true))
    -> 0.0169s
-- changeColumn(wicked_attachments, attachment_minorversion, integer, 
array(null => false, unsigned => true))
    -> 0.0270s
-- changeColumn(wicked_attachments, attachment_created, integer, 
array(null => false, unsigned => true))
    -> 0.0170s
-- changeColumn(wicked_attachment_history, page_id, integer, 
array(null => false, unsigned => true))
    -> 0.0475s
-- changeColumn(wicked_attachment_history, attachment_majorversion, 
integer, array(null => false, unsigned => true))
    -> 0.0321s
-- changeColumn(wicked_attachment_history, attachment_minorversion, 
integer, array(null => false, unsigned => true))
    -> 0.0158s
-- changeColumn(wicked_attachment_history, attachment_created, 
integer, array(null => false, unsigned => true))
    -> 0.0276s
== 3 WickedUnsignedInts: migrated (0.3722s) 
===================================

Migrating to WickedSingleRevisions (4)
== 4 WickedSingleRevisions: migrating 
=========================================
-- removePrimaryKey(wicked_history)
    -> 0.0233s
-- addColumn(wicked_pages, page_version, integer, array(null => false))
    -> 0.0169s
-- addColumn(wicked_history, page_version, integer, array(null => false))
    -> 0.0277s
-- select(SELECT page_id, page_majorversion, page_minorversion FROM 
wicked_history ORDER BY page_id, page_majorversion, page_minorversion)
    -> 0.0227s
-- update(UPDATE wicked_pages SET page_version = 1 WHERE page_version = 0)
    -> 0.0005s
    -> 0 rows
-- addPrimaryKey(wicked_history, array(0 => 'page_id', 1 => 'page_version'))
    -> 0.0393s
-- removeColumn(wicked_pages, page_majorversion)
    -> 0.0261s
-- removeColumn(wicked_pages, page_minorversion)
    -> 0.0103s
-- removeColumn(wicked_history, page_majorversion)
    -> 0.0467s
-- removeColumn(wicked_history, page_minorversion)
    -> 0.0104s
-- removePrimaryKey(wicked_attachment_history)
    -> 0.0286s
-- addColumn(wicked_attachments, attachment_version, integer, 
array(null => false))
    -> 0.0203s
-- addColumn(wicked_attachment_history, attachment_version, integer, 
array(null => false))
    -> 0.0162s
-- select(SELECT page_id, attachment_name, attachment_majorversion, 
attachment_minorversion FROM wicked_attachment_history ORDER BY 
page_id, attachment_name, attachment_majorversion, 
attachment_minorversion)
    -> 0.0000s
-- addLimitOffset(SELECT attachment_version FROM 
wicked_attachment_history WHERE page_id = ? AND attachment_name = ? 
ORDER BY attachment_version DESC, array(limit => 1))
    -> 0.0000s
-- select(SELECT page_id, attachment_name, attachment_majorversion, 
attachment_minorversion FROM wicked_attachments)
    -> 0.0000s
-- update(UPDATE wicked_attachments SET attachment_version = 1 WHERE 
attachment_version = 0)
    -> 0.0003s
    -> 0 rows
-- addPrimaryKey(wicked_attachment_history, array(0 => 'page_id', 1 => 
'attachment_name', 2 => 'attachment_version'))
    -> 0.0382s
-- removeColumn(wicked_attachments, attachment_majorversion)
    -> 0.0140s
-- removeColumn(wicked_attachments, attachment_minorversion)
    -> 0.0127s
-- removeColumn(wicked_attachment_history, attachment_majorversion)
    -> 0.0188s
-- removeColumn(wicked_attachment_history, attachment_minorversion)
    -> 0.0200s
== 4 WickedSingleRevisions: migrated (0.4009s) 
================================

Migrating to WickedRenamePages (5)
== 5 WickedRenamePages: migrating 
=============================================
-- selectValue(SELECT 1 FROM wicked_pages WHERE page_name = ?, array(0 
=> 'Wiki/AddingPages'))
    -> 0.0007s
-- beginDbTransaction()
    -> 0.0002s
-- update(UPDATE wicked_pages SET page_name = ? WHERE page_name = ?, 
array(0 => 'Wiki/AddingPages', 1 => 'AddingPages'))
    -> 0.0004s
    -> 0 rows
-- update(UPDATE wicked_history SET page_name = ? WHERE page_name = ?, 
array(0 => 'Wiki/AddingPages', 1 => 'AddingPages'))
    -> 0.0006s
    -> 0 rows
-- commitDbTransaction()
    -> 0.0001s
-- selectValue(SELECT 1 FROM wicked_pages WHERE page_name = ?, array(0 
=> 'Wiki/Usage'))
    -> 0.0004s
-- beginDbTransaction()
    -> 0.0001s
-- update(UPDATE wicked_pages SET page_name = ? WHERE page_name = ?, 
array(0 => 'Wiki/Usage', 1 => 'HowToUseWiki'))
    -> 0.0004s
    -> 0 rows
-- update(UPDATE wicked_history SET page_name = ? WHERE page_name = ?, 
array(0 => 'Wiki/Usage', 1 => 'HowToUseWiki'))
    -> 0.0005s
    -> 0 rows
-- commitDbTransaction()
    -> 0.0001s
-- selectValue(SELECT 1 FROM wicked_pages WHERE page_name = ?, array(0 
=> 'Wiki/SandBox'))
    -> 0.0004s
-- beginDbTransaction()
    -> 0.0001s
-- update(UPDATE wicked_pages SET page_name = ? WHERE page_name = ?, 
array(0 => 'Wiki/SandBox', 1 => 'SandBox'))
    -> 0.0004s
    -> 0 rows
-- update(UPDATE wicked_history SET page_name = ? WHERE page_name = ?, 
array(0 => 'Wiki/SandBox', 1 => 'SandBox'))
    -> 0.0004s
    -> 0 rows
-- commitDbTransaction()
    -> 0.0001s
-- selectValue(SELECT 1 FROM wicked_pages WHERE page_name = ?, array(0 
=> 'Wiki/Home'))
    -> 0.0004s
-- beginDbTransaction()
    -> 0.0001s
-- update(UPDATE wicked_pages SET page_name = ? WHERE page_name = ?, 
array(0 => 'Wiki/Home', 1 => 'WikiHome'))
    -> 0.0004s
    -> 0 rows
-- update(UPDATE wicked_history SET page_name = ? WHERE page_name = ?, 
array(0 => 'Wiki/Home', 1 => 'WikiHome'))
    -> 0.0004s
    -> 0 rows
-- commitDbTransaction()
    -> 0.0001s
-- selectValue(SELECT 1 FROM wicked_pages WHERE page_name = ?, array(0 
=> 'Wiki/Page'))
    -> 0.0004s
-- beginDbTransaction()
    -> 0.0001s
-- update(UPDATE wicked_pages SET page_name = ? WHERE page_name = ?, 
array(0 => 'Wiki/Page', 1 => 'WikiPage'))
    -> 0.0004s
    -> 0 rows
-- update(UPDATE wicked_history SET page_name = ? WHERE page_name = ?, 
array(0 => 'Wiki/Page', 1 => 'WikiPage'))
    -> 0.0004s
    -> 0 rows
-- commitDbTransaction()
    -> 0.0001s
-- selectValue(SELECT 1 FROM wicked_pages WHERE page_name = ?, array(0 
=> 'Wiki/TextFormat'))
    -> 0.0004s
-- beginDbTransaction()
    -> 0.0001s
-- update(UPDATE wicked_pages SET page_name = ? WHERE page_name = ?, 
array(0 => 'Wiki/TextFormat', 1 => 'WikiTextFormat'))
    -> 0.0004s
    -> 0 rows
-- update(UPDATE wicked_history SET page_name = ? WHERE page_name = ?, 
array(0 => 'Wiki/TextFormat', 1 => 'WikiTextFormat'))
    -> 0.0004s
    -> 0 rows
-- commitDbTransaction()
    -> 0.0001s
== 5 WickedRenamePages: migrated (0.0168s) 
====================================

[  INFO  ] Ending wicked schema version: 5


after that when i run the command again i got:

root@server:~# /var/www/pear/horde-db-migrate wicked
[  INFO  ] Migrating DB up.
[  INFO  ] Current wicked schema version: 4
Migrating to WickedRenamePages (5)
== 5 WickedRenamePages: migrating 
=============================================
-- selectValue(SELECT 1 FROM wicked_pages WHERE page_name = ?, array(0 
=> 'Wiki/AddingPages'))
    -> 0.0005s
-- beginDbTransaction()
    -> 0.0001s
-- update(UPDATE wicked_pages SET page_name = ? WHERE page_name = ?, 
array(0 => 'Wiki/AddingPages', 1 => 'AddingPages'))
    -> 0.0004s
    -> 0 rows
-- update(UPDATE wicked_history SET page_name = ? WHERE page_name = ?, 
array(0 => 'Wiki/AddingPages', 1 => 'AddingPages'))
    -> 0.0004s
    -> 0 rows
-- commitDbTransaction()
    -> 0.0001s
-- selectValue(SELECT 1 FROM wicked_pages WHERE page_name = ?, array(0 
=> 'Wiki/Usage'))
    -> 0.0004s
-- beginDbTransaction()
    -> 0.0001s
-- update(UPDATE wicked_pages SET page_name = ? WHERE page_name = ?, 
array(0 => 'Wiki/Usage', 1 => 'HowToUseWiki'))
    -> 0.0004s
    -> 0 rows
-- update(UPDATE wicked_history SET page_name = ? WHERE page_name = ?, 
array(0 => 'Wiki/Usage', 1 => 'HowToUseWiki'))
    -> 0.0004s
    -> 0 rows
-- commitDbTransaction()
    -> 0.0001s
-- selectValue(SELECT 1 FROM wicked_pages WHERE page_name = ?, array(0 
=> 'Wiki/SandBox'))
    -> 0.0004s
-- beginDbTransaction()
    -> 0.0001s
-- update(UPDATE wicked_pages SET page_name = ? WHERE page_name = ?, 
array(0 => 'Wiki/SandBox', 1 => 'SandBox'))
    -> 0.0004s
    -> 0 rows
-- update(UPDATE wicked_history SET page_name = ? WHERE page_name = ?, 
array(0 => 'Wiki/SandBox', 1 => 'SandBox'))
    -> 0.0004s
    -> 0 rows
-- commitDbTransaction()
    -> 0.0001s
-- selectValue(SELECT 1 FROM wicked_pages WHERE page_name = ?, array(0 
=> 'Wiki/Home'))
    -> 0.0004s
-- beginDbTransaction()
    -> 0.0001s
-- update(UPDATE wicked_pages SET page_name = ? WHERE page_name = ?, 
array(0 => 'Wiki/Home', 1 => 'WikiHome'))
    -> 0.0003s
    -> 0 rows
-- update(UPDATE wicked_history SET page_name = ? WHERE page_name = ?, 
array(0 => 'Wiki/Home', 1 => 'WikiHome'))
    -> 0.0004s
    -> 0 rows
-- commitDbTransaction()
    -> 0.0001s
-- selectValue(SELECT 1 FROM wicked_pages WHERE page_name = ?, array(0 
=> 'Wiki/Page'))
    -> 0.0004s
-- beginDbTransaction()
    -> 0.0001s
-- update(UPDATE wicked_pages SET page_name = ? WHERE page_name = ?, 
array(0 => 'Wiki/Page', 1 => 'WikiPage'))
    -> 0.0003s
    -> 0 rows
-- update(UPDATE wicked_history SET page_name = ? WHERE page_name = ?, 
array(0 => 'Wiki/Page', 1 => 'WikiPage'))
    -> 0.0004s
    -> 0 rows
-- commitDbTransaction()
    -> 0.0001s
-- selectValue(SELECT 1 FROM wicked_pages WHERE page_name = ?, array(0 
=> 'Wiki/TextFormat'))
    -> 0.0004s
-- beginDbTransaction()
    -> 0.0001s
-- update(UPDATE wicked_pages SET page_name = ? WHERE page_name = ?, 
array(0 => 'Wiki/TextFormat', 1 => 'WikiTextFormat'))
    -> 0.0004s
    -> 0 rows
-- update(UPDATE wicked_history SET page_name = ? WHERE page_name = ?, 
array(0 => 'Wiki/TextFormat', 1 => 'WikiTextFormat'))
    -> 0.0004s
    -> 0 rows
-- commitDbTransaction()
    -> 0.0001s
== 5 WickedRenamePages: migrated (0.0159s) 
====================================

[  INFO  ] Ending wicked schema version: 5



that i can repeat many many times and nothing changed

Saved Queries