[Rt-commit] rt branch, 4.2/upgrading-indexes-and-review, repushed
Alex Vandiver
alexmv at bestpractical.com
Wed Sep 4 16:21:36 EDT 2013
The branch 4.2/upgrading-indexes-and-review was deleted and repushed:
was e19e7ec7f1ee497f42e52c63d43a0f4ad6a47675
now 5d7572669a04236f0c2a2d2af933db0721864e01
1: 8056316 = 1: 8056316 a few functions to explore DB indexes
2: 5c53e58 = 2: 5c53e58 GroupMembers(GroupId, MemberId) index for SQLite
3: 943d5e6 = 3: 943d5e6 indexes action in rt-setup-database
4: fccb899 ! 4: 3d10b4d indexes on Groups table
@@ -104,10 +104,10 @@
CREATE TABLE ScripConditions (
id INTEGER NOT NULL AUTO_INCREMENT,
-diff --git a/etc/upgrade/4.1.10/indexes b/etc/upgrade/4.1.10/indexes
+diff --git a/etc/upgrade/4.1.23/indexes b/etc/upgrade/4.1.23/indexes
new file mode 100644
--- /dev/null
-+++ b/etc/upgrade/4.1.10/indexes
++++ b/etc/upgrade/4.1.23/indexes
@@
+use strict;
+use warnings;
5: b6f2037 ! 5: ede2c65 unique case insensitive indexes on Queues and Users
@@ -64,9 +64,9 @@
CREATE INDEX Users4 ON Users (EmailAddress);
-diff --git a/etc/upgrade/4.1.10/indexes b/etc/upgrade/4.1.10/indexes
---- a/etc/upgrade/4.1.10/indexes
-+++ b/etc/upgrade/4.1.10/indexes
+diff --git a/etc/upgrade/4.1.23/indexes b/etc/upgrade/4.1.23/indexes
+--- a/etc/upgrade/4.1.23/indexes
++++ b/etc/upgrade/4.1.23/indexes
@@
RT->Logger->info($msg);
}
6: 703bbac ! 6: cab37e9 indexes on cached group members
@@ -75,9 +75,9 @@
-diff --git a/etc/upgrade/4.1.10/indexes b/etc/upgrade/4.1.10/indexes
---- a/etc/upgrade/4.1.10/indexes
-+++ b/etc/upgrade/4.1.10/indexes
+diff --git a/etc/upgrade/4.1.23/indexes b/etc/upgrade/4.1.23/indexes
+--- a/etc/upgrade/4.1.23/indexes
++++ b/etc/upgrade/4.1.23/indexes
@@
}
}
7: ac5afe1 ! 7: 6d1a0b7 drop indexes that start from id
@@ -69,9 +69,9 @@
--- }}}
-diff --git a/etc/upgrade/4.1.10/indexes b/etc/upgrade/4.1.10/indexes
---- a/etc/upgrade/4.1.10/indexes
-+++ b/etc/upgrade/4.1.10/indexes
+diff --git a/etc/upgrade/4.1.23/indexes b/etc/upgrade/4.1.23/indexes
+--- a/etc/upgrade/4.1.23/indexes
++++ b/etc/upgrade/4.1.23/indexes
@@
);
}
8: 3a337f3 = 8: 65f68e0 Specify Instance even for RT::System groups
9: cc1a0ad = 9: b56144f ->id can be called as a class method on RT::System; use eval rather than ref() and can()
10: ab765bf = 10: dac0c5d Refactor duplicated role group code
11: 3a8ba5c ! 11: ec50917 move functions into RT::Handle from upgrade script
@@ -2,9 +2,9 @@
move functions into RT::Handle from upgrade script
-diff --git a/etc/upgrade/4.1.10/indexes b/etc/upgrade/4.1.10/indexes
---- a/etc/upgrade/4.1.10/indexes
-+++ b/etc/upgrade/4.1.10/indexes
+diff --git a/etc/upgrade/4.1.23/indexes b/etc/upgrade/4.1.23/indexes
+--- a/etc/upgrade/4.1.23/indexes
++++ b/etc/upgrade/4.1.23/indexes
@@
# cached group members
12: 40cd350 ! 12: fc62a82 de-duplicate Name in Users/Queues
@@ -9,9 +9,9 @@
I've tried to use RT's API, but not all objects are
available during 'indexes' upgrade action.
-diff --git a/etc/upgrade/4.1.10/indexes b/etc/upgrade/4.1.10/indexes
---- a/etc/upgrade/4.1.10/indexes
-+++ b/etc/upgrade/4.1.10/indexes
+diff --git a/etc/upgrade/4.1.23/indexes b/etc/upgrade/4.1.23/indexes
+--- a/etc/upgrade/4.1.23/indexes
++++ b/etc/upgrade/4.1.23/indexes
@@
RT->Logger->info($msg);
}
@@ -53,17 +53,16 @@
+ # skip first
+ shift @$ids;
+
-+ my $i = 0;
+ foreach my $id ( @$ids ) {
+ RT->Logger->debug("Changing $column of $record_class #". $id );
-+ $dbh->do("UPDATE $table SET $column = ? WHERE id = ?", undef, $value . '-dup-'.$$.++$i, $id);
++ $dbh->do("UPDATE $table SET $column = ? WHERE id = ?", undef, $value . '-dup-'.$id, $id);
+ }
+ }
+
+ if ( $found ) {
+ RT->Logger->warning(
-+ "Records in $table table had not unique values in $column column."
-+ ." $column has been changed for such records, search LIKE '%-dup-$$%'"
++ "Records in $table table had non-unique values in $column column."
++ ." $column has been changed for such records, and now matches '%-dup-%'"
+ );
+ }
+};
13: 0140d8d < --: ------- Move to open upgrade slot
14: 2449c65 < --: ------- Switch to a de-duplication name that is predictable and understandable
15: e19e7ec = 13: 5d75726 Adjust log levels to reduce noise and not hide true errors
More information about the Rt-commit
mailing list