[Rt-commit] rt branch, 3.8-trunk, updated. rt-3.8.5-273-gbca90b7

Alex M Vandiver alexmv at bestpractical.com
Wed Oct 7 15:33:56 EDT 2009


The branch, 3.8-trunk has been updated
       via  bca90b7bc4ca7e7bae277fd3c6f437cb148dbe16 (commit)
       via  330d0b6223de4ee5cec3bda1825211b54956bb9e (commit)
      from  4246d3260accd9b55eb946b31cd2ff868221838d (commit)

Summary of changes:
 UPGRADING                              |   10 ++++++++++
 etc/upgrade/split-out-cf-categories.in |    7 +++++++
 2 files changed, 17 insertions(+), 0 deletions(-)

- Log -----------------------------------------------------------------
commit 330d0b6223de4ee5cec3bda1825211b54956bb9e
Author: Alex Vandiver <alexmv at bestpractical.com>
Date:   Wed Oct 7 15:33:26 2009 -0400

    Allow specific CFs to be skipped

diff --git a/etc/upgrade/split-out-cf-categories.in b/etc/upgrade/split-out-cf-categories.in
index 9831a2c..f34a1b6 100644
--- a/etc/upgrade/split-out-cf-categories.in
+++ b/etc/upgrade/split-out-cf-categories.in
@@ -66,6 +66,7 @@ my $CFs = RT::CustomFields->new( $RT::SystemUser );
 $CFs->UnLimit;
 $CFs->Limit( FIELD => 'Type', VALUE => 'Select' );
 
+my $seen;
 while (my $cf  = $CFs->Next ) {
     next if $cf->BasedOnObj->Id;
     my @categories;
@@ -78,9 +79,14 @@ while (my $cf  = $CFs->Next ) {
     }
     next unless @categories;
 
+    $seen++;
     print "Found CF '@{[$cf->Name]}' with categories:\n";
     print "  $_\n" for @categories;
 
+    print "Split this CF's categories into a hierarchical custom field (Y/n)? ";
+    my $dothis = <>;
+    next if $dothis =~ /n/i;
+
     print "Enter name of CF to create as category ('@{[$cf->Name]} category'): ";
     my $newname = <>;
     chomp $newname;
@@ -162,3 +168,4 @@ while (my $cf  = $CFs->Next ) {
 }
 
 $RT::Handle->Commit;
+print "No custom fields with categories found\n" unless $seen;
\ No newline at end of file

commit bca90b7bc4ca7e7bae277fd3c6f437cb148dbe16
Author: Alex Vandiver <alexmv at bestpractical.com>
Date:   Wed Oct 7 15:33:43 2009 -0400

    Describe upgrade process for hierarchical CFs

diff --git a/UPGRADING b/UPGRADING
index 34d21a7..b6dd0de 100644
--- a/UPGRADING
+++ b/UPGRADING
@@ -26,6 +26,16 @@ when you run.
 
 /opt/rt3/sbin/rt-setup-database --dba root --prompt-for-dba-password --action upgrade
 
+Custom fields with categories can optionally be split out into
+hierarchical custom fields.  If you wish to convert your old
+category-based custom fields, run:
+
+    perl etc/upgrade/split-out-cf-categories
+
+It will prompt you for each custom field with categories that it
+finds, and the name of the custom field to create to store the
+categories.
+
 UPGRADING FROM 3.8.3 and earlier - Changes:
 
 Arguments to the NotifyGroup Scrip Action need

-----------------------------------------------------------------------


More information about the Rt-commit mailing list