[Rt-commit] r19288 - rtir/2.5/trunk/etc/upgrade/2.5.1
ruz at bestpractical.com
ruz at bestpractical.com
Sun Apr 19 22:08:29 EDT 2009
Author: ruz
Date: Sun Apr 19 22:08:28 2009
New Revision: 19288
Added:
rtir/2.5/trunk/etc/upgrade/2.5.1/
rtir/2.5/trunk/etc/upgrade/2.5.1/content
Log:
* add upgrade script for 2.5.1 where we rename CFs
Added: rtir/2.5/trunk/etc/upgrade/2.5.1/content
==============================================================================
--- (empty file)
+++ rtir/2.5/trunk/etc/upgrade/2.5.1/content Sun Apr 19 22:08:28 2009
@@ -0,0 +1,19 @@
+
+ at Initial = (
+ sub {
+ my $cfs = RT::CustomFields->new( $RT::SystemUser );
+ $cfs->Limit( COLUMN => 'Name', OPERATOR => 'STARTSWITH', VALUE => '_RTIR_' );
+ while ( my $cf = $cfs->Next ) {
+ my ($name, $new);
+ $new = $name = $cf->Name;
+
+ $new =~ s/^_RTIR_//i;
+ next if $name eq $new;
+
+ my ($status, $msg) = $cf->SetName( $new );
+ $RT::Logger->error("Couldn't rename custom field '$name': $msg");
+ }
+ },
+);
+
+
More information about the Rt-commit
mailing list