tag 773343 patch
thanks

On Sat, Dec 27, 2014 at 07:27:03PM +0200, Niko Tyni wrote:

> The smallest database change I can think of to fix the problem is
> something like
>  UPDATE Groups set Instance=1 WHERE Domain='RTx::AssetTracker::System-Role' 
> AND Description IS Null;
> which could presumably be dropped into the request-tracker4 dbconfig-common
> upgrade directories. I'd expect it to complete as a no-op on systems
> without RTx::AssetTracker installed.

The attached patch implements this. It's also pushed in the
ntyni/bug-773343 branch in the Alioth repository (see the Vcs-Git header.)

> Disclaimer: I don't really know what the 'Instance' field is used for,
> and the above change could well break RTx::AssetTracker or even RT
> itself. I've only tested that it allows the request-tracker4 upgrade to
> complete successfully with the (default) SQLite backend.  Testing with
> Pg/mysql would be good too, as the 'Description IS Null' part feels a
> bit fragile to me.

It turns out that Pg and mysql backends don't exhibit the issue at all,
so I'm only touching SQlite databases. I've now tested the patch as
far as successfully upgrading dbconfig-common managed RT installations
from wheezy to jessie+the patch on SQLite, Pg, and mysql, both with and
without rt4-extension-assettracker installed.

However, I have not actually tested to use RT after the patched
upgrade. It would be nice if somebody could do that.

> On a related note, does the wheezy RTx::AssetTracker even work with the
> jessie RT? If it doesn't, a Breaks: entry would probably be warranted.

I've added the Breaks as well in the git branch.
-- 
Niko Tyni   nt...@debian.org
>From 559785c4e88364b835823521a0e1648db985b05e Mon Sep 17 00:00:00 2001
From: Niko Tyni <nt...@debian.org>
Date: Sat, 27 Dec 2014 23:19:03 +0200
Subject: Fix upgrade problems caused by an RTx::AssetTracker installation bug

The setup of the wheezy rt4-extension-assettracker package
(RTx::AssetTracker 2.0.0b2) accidentally inserted two pairs of system role
accounts, causing upgrade failures on SQLite backends due to uniqueness
constraint violations.

Bug-Debian: https://bugs.debian.org/773343
Patch-Name: assettracker-sysgroups.diff
---
 etc/upgrade/4.1.0/schema.SQLite |    3 +++
 1 file changed, 3 insertions(+)
 create mode 100644 etc/upgrade/4.1.0/schema.SQLite

diff --git a/etc/upgrade/4.1.0/schema.SQLite b/etc/upgrade/4.1.0/schema.SQLite
new file mode 100644
index 0000000..b38fded
--- /dev/null
+++ b/etc/upgrade/4.1.0/schema.SQLite
@@ -0,0 +1,3 @@
+-- fix uniqueness constraint violations due to accidentally doubled system groups
+-- see https://bugs.debian.org/773343
+UPDATE Groups set Instance=1 WHERE Domain='RTx::AssetTracker::System-Role' AND Description IS Null;

Reply via email to