From cae37e3b496b3708461300fadfcf9d377c711a76 Mon Sep 17 00:00:00 2001
From: Niko Tyni <ntyni@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
Forwarded: not-needed
---
 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 00000000..b38fded5
--- /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;
