[Rt-commit] rt branch, 4.4/drop-unused-columns, created. rt-4.2.0-34-g04ffee6

Shawn Moore shawn at bestpractical.com
Fri May 15 17:27:40 EDT 2015


The branch, 4.4/drop-unused-columns has been created
        at  04ffee6202af1bdd6488fe2def3a439d174c8000 (commit)

- Log -----------------------------------------------------------------
commit eb29b20a4a872ba309f673217911c8d3062bf3e3
Author: Alex Vandiver <alexmv at bestpractical.com>
Date:   Thu Dec 5 12:39:37 2013 -0500

    Resolution and IssueStatement have never been used in core RT; drop them

diff --git a/etc/schema.Oracle b/etc/schema.Oracle
index effefc5..ee4a61d 100755
--- a/etc/schema.Oracle
+++ b/etc/schema.Oracle
@@ -263,8 +263,6 @@ CREATE TABLE Tickets (
         IsMerged                NUMBER(11,0) DEFAULT NULL NULL,
         Queue                   NUMBER(11,0) DEFAULT 0 NOT NULL,
         Type                    VARCHAR2(16),           
-        IssueStatement          NUMBER(11,0) DEFAULT 0 NOT NULL,
-        Resolution              NUMBER(11,0) DEFAULT 0 NOT NULL,
         Owner                   NUMBER(11,0) DEFAULT 0 NOT NULL,
         Subject                 VARCHAR2(200) DEFAULT '[no subject]', 
         InitialPriority         NUMBER(11,0) DEFAULT 0 NOT NULL,
diff --git a/etc/schema.Pg b/etc/schema.Pg
index e5e2a04..ed5e65a 100755
--- a/etc/schema.Pg
+++ b/etc/schema.Pg
@@ -416,8 +416,6 @@ CREATE TABLE Tickets (
   IsMerged smallint NULL DEFAULT NULL ,
   Queue integer NOT NULL DEFAULT 0  ,
   Type varchar(16) NULL  ,
-  IssueStatement integer NOT NULL DEFAULT 0  ,
-  Resolution integer NOT NULL DEFAULT 0  ,
   Owner integer NOT NULL DEFAULT 0  ,
   Subject varchar(200) NULL DEFAULT '[no subject]' ,
   InitialPriority integer NOT NULL DEFAULT 0  ,
diff --git a/etc/schema.SQLite b/etc/schema.SQLite
index c50e5b1..74a87db 100755
--- a/etc/schema.SQLite
+++ b/etc/schema.SQLite
@@ -293,8 +293,6 @@ CREATE TABLE Tickets (
   IsMerged int2 NULL DEFAULT NULL,
   Queue integer NULL DEFAULT 0 ,
   Type varchar(16) collate NOCASE NULL  ,
-  IssueStatement integer NULL DEFAULT 0 ,
-  Resolution integer NULL DEFAULT 0 ,
   Owner integer NULL DEFAULT 0 ,
   Subject varchar(200) collate NOCASE NULL DEFAULT '[no subject]' ,
   InitialPriority integer NULL DEFAULT 0 ,
diff --git a/etc/schema.mysql b/etc/schema.mysql
index 3669fb3..3a18da1 100755
--- a/etc/schema.mysql
+++ b/etc/schema.mysql
@@ -274,8 +274,6 @@ CREATE TABLE Tickets (
   IsMerged int2 NULL DEFAULT NULL,
   Queue integer NOT NULL DEFAULT 0  ,
   Type varchar(16) CHARACTER SET ascii NULL  ,
-  IssueStatement integer NOT NULL DEFAULT 0  ,
-  Resolution integer NOT NULL DEFAULT 0  ,
   Owner integer NOT NULL DEFAULT 0  ,
   Subject varchar(200) NULL DEFAULT '[no subject]' ,
   InitialPriority integer NOT NULL DEFAULT 0  ,
diff --git a/etc/upgrade/4.3.0/schema.Oracle b/etc/upgrade/4.3.0/schema.Oracle
new file mode 100644
index 0000000..831c6ff
--- /dev/null
+++ b/etc/upgrade/4.3.0/schema.Oracle
@@ -0,0 +1,2 @@
+ALTER TABLE Tickets
+  DROP (IssueStatement, Resolution);
diff --git a/etc/upgrade/4.3.0/schema.Pg b/etc/upgrade/4.3.0/schema.Pg
new file mode 100644
index 0000000..0a5dc5d
--- /dev/null
+++ b/etc/upgrade/4.3.0/schema.Pg
@@ -0,0 +1,3 @@
+ALTER TABLE Tickets
+  DROP COLUMN IssueStatement,
+  DROP COLUMN Resolution;
diff --git a/etc/upgrade/4.3.0/schema.SQLite b/etc/upgrade/4.3.0/schema.SQLite
new file mode 100644
index 0000000..7ed6f3d
--- /dev/null
+++ b/etc/upgrade/4.3.0/schema.SQLite
@@ -0,0 +1 @@
+-- There is no "drop column" in SQLite
diff --git a/etc/upgrade/4.3.0/schema.mysql b/etc/upgrade/4.3.0/schema.mysql
new file mode 100644
index 0000000..0a5dc5d
--- /dev/null
+++ b/etc/upgrade/4.3.0/schema.mysql
@@ -0,0 +1,3 @@
+ALTER TABLE Tickets
+  DROP COLUMN IssueStatement,
+  DROP COLUMN Resolution;
diff --git a/lib/RT/Ticket.pm b/lib/RT/Ticket.pm
index 36abca2..1773af9 100644
--- a/lib/RT/Ticket.pm
+++ b/lib/RT/Ticket.pm
@@ -3140,42 +3140,6 @@ Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
 =cut
 
 
-=head2 IssueStatement
-
-Returns the current value of IssueStatement.
-(In the database, IssueStatement is stored as int(11).)
-
-
-
-=head2 SetIssueStatement VALUE
-
-
-Set IssueStatement to VALUE.
-Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
-(In the database, IssueStatement will be stored as a int(11).)
-
-
-=cut
-
-
-=head2 Resolution
-
-Returns the current value of Resolution.
-(In the database, Resolution is stored as int(11).)
-
-
-
-=head2 SetResolution VALUE
-
-
-Set Resolution to VALUE.
-Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
-(In the database, Resolution will be stored as a int(11).)
-
-
-=cut
-
-
 =head2 Owner
 
 Returns the current value of Owner.
@@ -3496,10 +3460,6 @@ sub _CoreAccessible {
                 {read => 1, write => 1, sql_type => 4, length => 11,  is_blob => 0,  is_numeric => 1,  type => 'int(11)', default => '0'},
         Type =>
                 {read => 1, write => 1, sql_type => 12, length => 16,  is_blob => 0,  is_numeric => 0,  type => 'varchar(16)', default => ''},
-        IssueStatement =>
-                {read => 1, write => 1, sql_type => 4, length => 11,  is_blob => 0,  is_numeric => 1,  type => 'int(11)', default => '0'},
-        Resolution =>
-                {read => 1, write => 1, sql_type => 4, length => 11,  is_blob => 0,  is_numeric => 1,  type => 'int(11)', default => '0'},
         Owner =>
                 {read => 1, write => 1, sql_type => 4, length => 11,  is_blob => 0,  is_numeric => 1,  type => 'int(11)', default => '0'},
         Subject =>
diff --git a/t/security/CVE-2011-4460-rows-per-page.t b/t/security/CVE-2011-4460-rows-per-page.t
index 92d6853..0623408 100644
--- a/t/security/CVE-2011-4460-rows-per-page.t
+++ b/t/security/CVE-2011-4460-rows-per-page.t
@@ -21,7 +21,7 @@ $root->Load('root');
 my $password = $root->__Value('Password');
 ok $password, 'pulled hashed password from db';
 
-my $sql = q[1 union select 1+id as id, 1+id as EffectiveId, 1 as Queue, 'ticket' as Type, 0 as IssueStatement, 0 as Resolution, 12 as Owner, Password as Subject, 0 as InitialPriority, 0 as FinalPriority, 0 as Priority, 0 as TimeEstimated, 0 as TimeWorked, Name as Status, 0 as TimeLeft, null as Told, null as Starts, null as Started, null as Due, null as Resolved, 0 as LastUpdatedBy, null as LastUpdated, 6 as Creator, null as Created, 0 as Disabled from Users];
+my $sql = q[1 union select 1+id as id, 1+id as EffectiveId, 1 as Queue, 'ticket' as Type, 12 as Owner, Password as Subject, 0 as InitialPriority, 0 as FinalPriority, 0 as Priority, 0 as TimeEstimated, 0 as TimeWorked, Name as Status, 0 as TimeLeft, null as Told, null as Starts, null as Started, null as Due, null as Resolved, 0 as LastUpdatedBy, null as LastUpdated, 6 as Creator, null as Created, 0 as Disabled from Users];
 RT::Interface::Web::EscapeURI(\$sql);
 
 $m->get_ok("$base/Search/Results.html?Format=id,Subject,Status;Query=id%3E0;OrderBy=|;Rows=$sql");

commit 26986e30912c3d262dc15f94ab7946e4b08df593
Author: Alex Vandiver <alexmv at bestpractical.com>
Date:   Thu Dec 5 12:57:58 2013 -0500

    EmailEncoding and WebEncoding have never been used in core RT
    
    Additionally, their encoding differs in upgraded-from-3.6 and
    upgraded-from-3.8 RT installs, because upgrade-mysql-schema.pl did not
    set them to be UTF-8, but new installs of RT 3.8 defaulted them to being
    so.

diff --git a/etc/schema.Oracle b/etc/schema.Oracle
index ee4a61d..2441a7e 100755
--- a/etc/schema.Oracle
+++ b/etc/schema.Oracle
@@ -225,8 +225,6 @@ CREATE TABLE Users (
         RealName                VARCHAR2(120),
         NickName                VARCHAR2(16),
         Lang                    VARCHAR2(16),
-        EmailEncoding           VARCHAR2(16),
-        WebEncoding             VARCHAR2(16),
         ExternalContactInfoId   VARCHAR2(100),
         ContactInfoSystem       VARCHAR2(30),
         ExternalAuthId          VARCHAR2(100),
diff --git a/etc/schema.Pg b/etc/schema.Pg
index ed5e65a..99fffbc 100755
--- a/etc/schema.Pg
+++ b/etc/schema.Pg
@@ -364,8 +364,6 @@ CREATE TABLE Users (
   RealName varchar(120) NULL  ,
   NickName varchar(16) NULL  ,
   Lang varchar(16) NULL  ,
-  EmailEncoding varchar(16) NULL  ,
-  WebEncoding varchar(16) NULL  ,
   ExternalContactInfoId varchar(100) NULL  ,
   ContactInfoSystem varchar(30) NULL  ,
   ExternalAuthId varchar(100) NULL  ,
diff --git a/etc/schema.SQLite b/etc/schema.SQLite
index 74a87db..080b23d 100755
--- a/etc/schema.SQLite
+++ b/etc/schema.SQLite
@@ -250,8 +250,6 @@ CREATE TABLE Users (
   RealName varchar(120) collate NOCASE NULL  ,
   NickName varchar(16) collate NOCASE NULL  ,
   Lang varchar(16) collate NOCASE NULL  ,
-  EmailEncoding varchar(16) collate NOCASE NULL  ,
-  WebEncoding varchar(16) collate NOCASE NULL  ,
   ExternalContactInfoId varchar(100) collate NOCASE NULL  ,
   ContactInfoSystem varchar(30) collate NOCASE NULL  ,
   ExternalAuthId varchar(100) collate NOCASE NULL  ,
diff --git a/etc/schema.mysql b/etc/schema.mysql
index 3a18da1..25a2466 100755
--- a/etc/schema.mysql
+++ b/etc/schema.mysql
@@ -233,8 +233,6 @@ CREATE TABLE Users (
   RealName varchar(120) NULL  ,
   NickName varchar(16) NULL  ,
   Lang varchar(16) NULL  ,
-  EmailEncoding varchar(16) NULL  ,
-  WebEncoding varchar(16) NULL  ,
   ExternalContactInfoId varchar(100) NULL  ,
   ContactInfoSystem varchar(30) NULL  ,
   ExternalAuthId varchar(100) NULL  ,
diff --git a/etc/upgrade/4.3.0/schema.Oracle b/etc/upgrade/4.3.0/schema.Oracle
index 831c6ff..84058bb 100644
--- a/etc/upgrade/4.3.0/schema.Oracle
+++ b/etc/upgrade/4.3.0/schema.Oracle
@@ -1,2 +1,5 @@
 ALTER TABLE Tickets
   DROP (IssueStatement, Resolution);
+
+ALTER TABLE Users
+  DROP (EmailEncoding, WebEncoding);
diff --git a/etc/upgrade/4.3.0/schema.Pg b/etc/upgrade/4.3.0/schema.Pg
index 0a5dc5d..83016f0 100644
--- a/etc/upgrade/4.3.0/schema.Pg
+++ b/etc/upgrade/4.3.0/schema.Pg
@@ -1,3 +1,7 @@
 ALTER TABLE Tickets
   DROP COLUMN IssueStatement,
   DROP COLUMN Resolution;
+
+ALTER TABLE Users
+  DROP COLUMN EmailEncoding,
+  DROP COLUMN WebEncoding;
diff --git a/etc/upgrade/4.3.0/schema.mysql b/etc/upgrade/4.3.0/schema.mysql
index 0a5dc5d..83016f0 100644
--- a/etc/upgrade/4.3.0/schema.mysql
+++ b/etc/upgrade/4.3.0/schema.mysql
@@ -1,3 +1,7 @@
 ALTER TABLE Tickets
   DROP COLUMN IssueStatement,
   DROP COLUMN Resolution;
+
+ALTER TABLE Users
+  DROP COLUMN EmailEncoding,
+  DROP COLUMN WebEncoding;
diff --git a/etc/upgrade/upgrade-mysql-schema.pl b/etc/upgrade/upgrade-mysql-schema.pl
index 98eb7b4..11edb27 100755
--- a/etc/upgrade/upgrade-mysql-schema.pl
+++ b/etc/upgrade/upgrade-mysql-schema.pl
@@ -245,8 +245,6 @@ my %charset = (
         RealName  => 'utf8',
         NickName  => 'utf8',
         Lang  => 'ascii',
-        EmailEncoding  => 'ascii',
-        WebEncoding  => 'ascii',
         ExternalContactInfoId  => 'utf8',
         ContactInfoSystem  => 'utf8',
         ExternalAuthId  => 'utf8',
diff --git a/lib/RT/User.pm b/lib/RT/User.pm
index 9500aca..659be12 100644
--- a/lib/RT/User.pm
+++ b/lib/RT/User.pm
@@ -96,8 +96,6 @@ sub _OverlayAccessible {
           RealName              => { public => 1 },
           NickName              => { public => 1 },
           Lang                  => { public => 1 },
-          EmailEncoding         => { public => 1 },
-          WebEncoding           => { public => 1 },
           ExternalContactInfoId => { public => 1,  admin => 1 },
           ContactInfoSystem     => { public => 1,  admin => 1 },
           ExternalAuthId        => { public => 1,  admin => 1 },
@@ -1950,8 +1948,6 @@ Create takes a hash of values and creates a row in the database:
   varchar(120) 'RealName'.
   varchar(16) 'NickName'.
   varchar(16) 'Lang'.
-  varchar(16) 'EmailEncoding'.
-  varchar(16) 'WebEncoding'.
   varchar(100) 'ExternalContactInfoId'.
   varchar(30) 'ContactInfoSystem'.
   varchar(100) 'ExternalAuthId'.
@@ -2182,42 +2178,6 @@ Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
 =cut
 
 
-=head2 EmailEncoding
-
-Returns the current value of EmailEncoding. 
-(In the database, EmailEncoding is stored as varchar(16).)
-
-
-
-=head2 SetEmailEncoding VALUE
-
-
-Set EmailEncoding to VALUE. 
-Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
-(In the database, EmailEncoding will be stored as a varchar(16).)
-
-
-=cut
-
-
-=head2 WebEncoding
-
-Returns the current value of WebEncoding. 
-(In the database, WebEncoding is stored as varchar(16).)
-
-
-
-=head2 SetWebEncoding VALUE
-
-
-Set WebEncoding to VALUE. 
-Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
-(In the database, WebEncoding will be stored as a varchar(16).)
-
-
-=cut
-
-
 =head2 ExternalContactInfoId
 
 Returns the current value of ExternalContactInfoId. 
@@ -2606,10 +2566,6 @@ sub _CoreAccessible {
         {read => 1, write => 1, sql_type => 12, length => 16,  is_blob => 0,  is_numeric => 0,  type => 'varchar(16)', default => ''},
         Lang => 
         {read => 1, write => 1, sql_type => 12, length => 16,  is_blob => 0,  is_numeric => 0,  type => 'varchar(16)', default => ''},
-        EmailEncoding => 
-        {read => 1, write => 1, sql_type => 12, length => 16,  is_blob => 0,  is_numeric => 0,  type => 'varchar(16)', default => ''},
-        WebEncoding => 
-        {read => 1, write => 1, sql_type => 12, length => 16,  is_blob => 0,  is_numeric => 0,  type => 'varchar(16)', default => ''},
         ExternalContactInfoId => 
         {read => 1, write => 1, sql_type => 12, length => 100,  is_blob => 0,  is_numeric => 0,  type => 'varchar(100)', default => ''},
         ContactInfoSystem => 
diff --git a/share/html/Admin/Users/Modify.html b/share/html/Admin/Users/Modify.html
index 2585c8c..65ab729 100644
--- a/share/html/Admin/Users/Modify.html
+++ b/share/html/Admin/Users/Modify.html
@@ -252,8 +252,6 @@ else {
             RealName              => $ARGS{'RealName'},
             NickName              => $ARGS{'NickName'},
             Lang                  => $ARGS{'Lang'},
-            EmailEncoding         => $ARGS{'EmailEncoding'},
-            WebEncoding           => $ARGS{'WebEncoding'},
             ExternalContactInfoId => $ARGS{'ExternalContactInfoId'},
             ContactInfoSystem     => $ARGS{'ContactInfoSystem'},
             Gecos                 => $ARGS{'Gecos'},
@@ -304,7 +302,7 @@ $m->callback( %ARGS, CallbackName => 'BeforeUpdate', User => $UserObj, ARGSRef =
 if ($UserObj->Id && $id ne 'new') {
 
     my @fields = qw(Name Comments Signature EmailAddress FreeformContactInfo 
-                    Organization RealName NickName Lang EmailEncoding WebEncoding 
+                    Organization RealName NickName Lang
                     ExternalContactInfoId ContactInfoSystem Gecos ExternalAuthId 
                     AuthSystem HomePhone WorkPhone MobilePhone PagerPhone Address1
                     Address2 City State Zip Country 
@@ -384,8 +382,6 @@ $SetPrivileged => undef
 $Enabled => undef
 $SetEnabled => undef
 $Lang  => undef
-$EmailEncoding  => undef
-$WebEncoding => undef
 $ExternalContactInfoId  => undef
 $ContactInfoSystem  => undef
 $Gecos => undef
diff --git a/share/html/Admin/Users/index.html b/share/html/Admin/Users/index.html
index a0d38df..74ecb60 100644
--- a/share/html/Admin/Users/index.html
+++ b/share/html/Admin/Users/index.html
@@ -139,7 +139,7 @@ my %sorted = map { $_ => $i++ } qw(
 );
 
 my @attrs = sort { $sorted{$a} <=> $sorted{$b} }
-            grep { !/(?:^id$|ContactInfo|Encoding|^External|System|PGPKey|AuthToken|^Last|^Creat(?:ed|or)$|^Signature$)/ }
+            grep { !/(?:^id$|ContactInfo|^External|System|PGPKey|AuthToken|^Last|^Creat(?:ed|or)$|^Signature$)/ }
             RT::User->ReadableAttributes;
 my @fields;
 
diff --git a/share/html/REST/1.0/Forms/user/default b/share/html/REST/1.0/Forms/user/default
index f12dd0c..107ca03 100644
--- a/share/html/REST/1.0/Forms/user/default
+++ b/share/html/REST/1.0/Forms/user/default
@@ -59,8 +59,8 @@ my %data = %$changes;
 my $user = RT::User->new($session{CurrentUser});
 my @fields = qw(RealName NickName Gecos Organization Address1 Address2 City
                 State Zip Country HomePhone WorkPhone MobilePhone PagerPhone
-                FreeformContactInfo Comments Signature Lang EmailEncoding
-                WebEncoding ExternalContactInfoId ContactInfoSystem
+                FreeformContactInfo Comments Signature Lang
+                ExternalContactInfoId ContactInfoSystem
                 ExternalAuthId AuthSystem Privileged Disabled);
 my %fields = map { lc $_ => $_ } @fields;
 
diff --git a/share/html/User/Prefs.html b/share/html/User/Prefs.html
index e7b3c9a..bdc5b4f 100644
--- a/share/html/User/Prefs.html
+++ b/share/html/User/Prefs.html
@@ -225,7 +225,7 @@ if ( $ARGS{'ResetAuthToken'} ) {
 else {
     my @fields = qw(
         Name Comments Signature EmailAddress FreeformContactInfo 
-        Organization RealName NickName Lang EmailEncoding WebEncoding 
+        Organization RealName NickName Lang
         ExternalContactInfoId ContactInfoSystem Gecos ExternalAuthId 
         AuthSystem HomePhone WorkPhone MobilePhone PagerPhone Address1
         Address2 City State Zip Country Timezone
@@ -287,8 +287,6 @@ $SetPrivileged => undef
 $Enabled => undef
 $SetEnabled => undef
 $Lang  => undef
-$EmailEncoding  => undef
-$WebEncoding => undef
 $ExternalContactInfoId  => undef
 $ContactInfoSystem  => undef
 $Gecos => undef

commit 8db7c752310e41acf20817d1594c0d4f598a50d1
Author: Alex Vandiver <alexmv at bestpractical.com>
Date:   Thu Dec 5 13:14:53 2013 -0500

    Drop all "external contact" columns from users

diff --git a/etc/schema.Oracle b/etc/schema.Oracle
index 2441a7e..e74a05f 100755
--- a/etc/schema.Oracle
+++ b/etc/schema.Oracle
@@ -225,10 +225,6 @@ CREATE TABLE Users (
         RealName                VARCHAR2(120),
         NickName                VARCHAR2(16),
         Lang                    VARCHAR2(16),
-        ExternalContactInfoId   VARCHAR2(100),
-        ContactInfoSystem       VARCHAR2(30),
-        ExternalAuthId          VARCHAR2(100),
-        AuthSystem              VARCHAR2(30),
         Gecos                   VARCHAR2(16),
         HomePhone               VARCHAR2(30),
         WorkPhone               VARCHAR2(30),
diff --git a/etc/schema.Pg b/etc/schema.Pg
index 99fffbc..47c8cc2 100755
--- a/etc/schema.Pg
+++ b/etc/schema.Pg
@@ -364,10 +364,6 @@ CREATE TABLE Users (
   RealName varchar(120) NULL  ,
   NickName varchar(16) NULL  ,
   Lang varchar(16) NULL  ,
-  ExternalContactInfoId varchar(100) NULL  ,
-  ContactInfoSystem varchar(30) NULL  ,
-  ExternalAuthId varchar(100) NULL  ,
-  AuthSystem varchar(30) NULL  ,
   Gecos varchar(16) NULL  ,
   HomePhone varchar(30) NULL  ,
   WorkPhone varchar(30) NULL  ,
diff --git a/etc/schema.SQLite b/etc/schema.SQLite
index 080b23d..6f63ae4 100755
--- a/etc/schema.SQLite
+++ b/etc/schema.SQLite
@@ -250,10 +250,6 @@ CREATE TABLE Users (
   RealName varchar(120) collate NOCASE NULL  ,
   NickName varchar(16) collate NOCASE NULL  ,
   Lang varchar(16) collate NOCASE NULL  ,
-  ExternalContactInfoId varchar(100) collate NOCASE NULL  ,
-  ContactInfoSystem varchar(30) collate NOCASE NULL  ,
-  ExternalAuthId varchar(100) collate NOCASE NULL  ,
-  AuthSystem varchar(30) collate NOCASE NULL  ,
   Gecos varchar(16) collate NOCASE NULL  ,
   HomePhone varchar(30) collate NOCASE NULL  ,
   WorkPhone varchar(30) collate NOCASE NULL  ,
diff --git a/etc/schema.mysql b/etc/schema.mysql
index 25a2466..94dfe03 100755
--- a/etc/schema.mysql
+++ b/etc/schema.mysql
@@ -233,10 +233,6 @@ CREATE TABLE Users (
   RealName varchar(120) NULL  ,
   NickName varchar(16) NULL  ,
   Lang varchar(16) NULL  ,
-  ExternalContactInfoId varchar(100) NULL  ,
-  ContactInfoSystem varchar(30) NULL  ,
-  ExternalAuthId varchar(100) NULL  ,
-  AuthSystem varchar(30) NULL  ,
   Gecos varchar(16) NULL  ,
   HomePhone varchar(30) NULL  ,
   WorkPhone varchar(30) NULL  ,
diff --git a/etc/upgrade/4.3.0/schema.Oracle b/etc/upgrade/4.3.0/schema.Oracle
index 84058bb..47795d3 100644
--- a/etc/upgrade/4.3.0/schema.Oracle
+++ b/etc/upgrade/4.3.0/schema.Oracle
@@ -2,4 +2,5 @@ ALTER TABLE Tickets
   DROP (IssueStatement, Resolution);
 
 ALTER TABLE Users
-  DROP (EmailEncoding, WebEncoding);
+  DROP (EmailEncoding, WebEncoding,
+        ExternalContactInfoId, ContactInfoSystem, ExternalAuthId, AuthSystem);
diff --git a/etc/upgrade/4.3.0/schema.Pg b/etc/upgrade/4.3.0/schema.Pg
index 83016f0..6dd7bc9 100644
--- a/etc/upgrade/4.3.0/schema.Pg
+++ b/etc/upgrade/4.3.0/schema.Pg
@@ -4,4 +4,8 @@ ALTER TABLE Tickets
 
 ALTER TABLE Users
   DROP COLUMN EmailEncoding,
-  DROP COLUMN WebEncoding;
+  DROP COLUMN WebEncoding,
+  DROP COLUMN ExternalContactInfoId,
+  DROP COLUMN ContactInfoSystem,
+  DROP COLUMN ExternalAuthId,
+  DROP COLUMN AuthSystem;
diff --git a/etc/upgrade/4.3.0/schema.mysql b/etc/upgrade/4.3.0/schema.mysql
index 83016f0..6dd7bc9 100644
--- a/etc/upgrade/4.3.0/schema.mysql
+++ b/etc/upgrade/4.3.0/schema.mysql
@@ -4,4 +4,8 @@ ALTER TABLE Tickets
 
 ALTER TABLE Users
   DROP COLUMN EmailEncoding,
-  DROP COLUMN WebEncoding;
+  DROP COLUMN WebEncoding,
+  DROP COLUMN ExternalContactInfoId,
+  DROP COLUMN ContactInfoSystem,
+  DROP COLUMN ExternalAuthId,
+  DROP COLUMN AuthSystem;
diff --git a/etc/upgrade/upgrade-mysql-schema.pl b/etc/upgrade/upgrade-mysql-schema.pl
index 11edb27..9a0207e 100755
--- a/etc/upgrade/upgrade-mysql-schema.pl
+++ b/etc/upgrade/upgrade-mysql-schema.pl
@@ -245,10 +245,6 @@ my %charset = (
         RealName  => 'utf8',
         NickName  => 'utf8',
         Lang  => 'ascii',
-        ExternalContactInfoId  => 'utf8',
-        ContactInfoSystem  => 'utf8',
-        ExternalAuthId  => 'utf8',
-        AuthSystem  => 'utf8',
         Gecos  => 'utf8',
         HomePhone  => 'utf8',
         WorkPhone  => 'utf8',
diff --git a/lib/RT/User.pm b/lib/RT/User.pm
index 659be12..45aa570 100644
--- a/lib/RT/User.pm
+++ b/lib/RT/User.pm
@@ -96,10 +96,6 @@ sub _OverlayAccessible {
           RealName              => { public => 1 },
           NickName              => { public => 1 },
           Lang                  => { public => 1 },
-          ExternalContactInfoId => { public => 1,  admin => 1 },
-          ContactInfoSystem     => { public => 1,  admin => 1 },
-          ExternalAuthId        => { public => 1,  admin => 1 },
-          AuthSystem            => { public => 1,  admin => 1 },
           Gecos                 => { public => 1,  admin => 1 },
           PGPKey                => { public => 1,  admin => 1 },
           SMIMECertificate      => { public => 1,  admin => 1 },
@@ -1948,10 +1944,6 @@ Create takes a hash of values and creates a row in the database:
   varchar(120) 'RealName'.
   varchar(16) 'NickName'.
   varchar(16) 'Lang'.
-  varchar(100) 'ExternalContactInfoId'.
-  varchar(30) 'ContactInfoSystem'.
-  varchar(100) 'ExternalAuthId'.
-  varchar(30) 'AuthSystem'.
   varchar(16) 'Gecos'.
   varchar(30) 'HomePhone'.
   varchar(30) 'WorkPhone'.
@@ -2178,78 +2170,6 @@ Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
 =cut
 
 
-=head2 ExternalContactInfoId
-
-Returns the current value of ExternalContactInfoId. 
-(In the database, ExternalContactInfoId is stored as varchar(100).)
-
-
-
-=head2 SetExternalContactInfoId VALUE
-
-
-Set ExternalContactInfoId to VALUE. 
-Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
-(In the database, ExternalContactInfoId will be stored as a varchar(100).)
-
-
-=cut
-
-
-=head2 ContactInfoSystem
-
-Returns the current value of ContactInfoSystem. 
-(In the database, ContactInfoSystem is stored as varchar(30).)
-
-
-
-=head2 SetContactInfoSystem VALUE
-
-
-Set ContactInfoSystem to VALUE. 
-Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
-(In the database, ContactInfoSystem will be stored as a varchar(30).)
-
-
-=cut
-
-
-=head2 ExternalAuthId
-
-Returns the current value of ExternalAuthId. 
-(In the database, ExternalAuthId is stored as varchar(100).)
-
-
-
-=head2 SetExternalAuthId VALUE
-
-
-Set ExternalAuthId to VALUE. 
-Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
-(In the database, ExternalAuthId will be stored as a varchar(100).)
-
-
-=cut
-
-
-=head2 AuthSystem
-
-Returns the current value of AuthSystem. 
-(In the database, AuthSystem is stored as varchar(30).)
-
-
-
-=head2 SetAuthSystem VALUE
-
-
-Set AuthSystem to VALUE. 
-Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
-(In the database, AuthSystem will be stored as a varchar(30).)
-
-
-=cut
-
-
 =head2 Gecos
 
 Returns the current value of Gecos. 
@@ -2566,14 +2486,6 @@ sub _CoreAccessible {
         {read => 1, write => 1, sql_type => 12, length => 16,  is_blob => 0,  is_numeric => 0,  type => 'varchar(16)', default => ''},
         Lang => 
         {read => 1, write => 1, sql_type => 12, length => 16,  is_blob => 0,  is_numeric => 0,  type => 'varchar(16)', default => ''},
-        ExternalContactInfoId => 
-        {read => 1, write => 1, sql_type => 12, length => 100,  is_blob => 0,  is_numeric => 0,  type => 'varchar(100)', default => ''},
-        ContactInfoSystem => 
-        {read => 1, write => 1, sql_type => 12, length => 30,  is_blob => 0,  is_numeric => 0,  type => 'varchar(30)', default => ''},
-        ExternalAuthId => 
-        {read => 1, write => 1, sql_type => 12, length => 100,  is_blob => 0,  is_numeric => 0,  type => 'varchar(100)', default => ''},
-        AuthSystem => 
-        {read => 1, write => 1, sql_type => 12, length => 30,  is_blob => 0,  is_numeric => 0,  type => 'varchar(30)', default => ''},
         Gecos => 
         {read => 1, write => 1, sql_type => 12, length => 16,  is_blob => 0,  is_numeric => 0,  type => 'varchar(16)', default => ''},
         HomePhone => 
diff --git a/share/html/Admin/Users/Modify.html b/share/html/Admin/Users/Modify.html
index 65ab729..7c6dd32 100644
--- a/share/html/Admin/Users/Modify.html
+++ b/share/html/Admin/Users/Modify.html
@@ -252,11 +252,7 @@ else {
             RealName              => $ARGS{'RealName'},
             NickName              => $ARGS{'NickName'},
             Lang                  => $ARGS{'Lang'},
-            ExternalContactInfoId => $ARGS{'ExternalContactInfoId'},
-            ContactInfoSystem     => $ARGS{'ContactInfoSystem'},
             Gecos                 => $ARGS{'Gecos'},
-            ExternalAuthId        => $ARGS{'ExternalAuthId'},
-            AuthSystem            => $ARGS{'AuthSystem'},
             HomePhone             => $ARGS{'HomePhone'},
             WorkPhone             => $ARGS{'WorkPhone'},
             MobilePhone           => $ARGS{'MobilePhone'},
@@ -302,9 +298,8 @@ $m->callback( %ARGS, CallbackName => 'BeforeUpdate', User => $UserObj, ARGSRef =
 if ($UserObj->Id && $id ne 'new') {
 
     my @fields = qw(Name Comments Signature EmailAddress FreeformContactInfo 
-                    Organization RealName NickName Lang
-                    ExternalContactInfoId ContactInfoSystem Gecos ExternalAuthId 
-                    AuthSystem HomePhone WorkPhone MobilePhone PagerPhone Address1
+                    Organization RealName NickName Lang Gecos
+                    HomePhone WorkPhone MobilePhone PagerPhone Address1
                     Address2 City State Zip Country 
                    );
 
@@ -382,11 +377,7 @@ $SetPrivileged => undef
 $Enabled => undef
 $SetEnabled => undef
 $Lang  => undef
-$ExternalContactInfoId  => undef
-$ContactInfoSystem  => undef
 $Gecos => undef
-$ExternalAuthId  => undef
-$AuthSystem  => undef
 $HomePhone => undef
 $WorkPhone  => undef
 $MobilePhone  => undef
diff --git a/share/html/Admin/Users/index.html b/share/html/Admin/Users/index.html
index 74ecb60..acc0d11 100644
--- a/share/html/Admin/Users/index.html
+++ b/share/html/Admin/Users/index.html
@@ -139,7 +139,7 @@ my %sorted = map { $_ => $i++ } qw(
 );
 
 my @attrs = sort { $sorted{$a} <=> $sorted{$b} }
-            grep { !/(?:^id$|ContactInfo|^External|System|PGPKey|AuthToken|^Last|^Creat(?:ed|or)$|^Signature$)/ }
+            grep { !/(?:^id$|ContactInfo|PGPKey|AuthToken|^Last|^Creat(?:ed|or)$|^Signature$)/ }
             RT::User->ReadableAttributes;
 my @fields;
 
diff --git a/share/html/REST/1.0/Forms/user/default b/share/html/REST/1.0/Forms/user/default
index 107ca03..160a317 100644
--- a/share/html/REST/1.0/Forms/user/default
+++ b/share/html/REST/1.0/Forms/user/default
@@ -60,8 +60,7 @@ my $user = RT::User->new($session{CurrentUser});
 my @fields = qw(RealName NickName Gecos Organization Address1 Address2 City
                 State Zip Country HomePhone WorkPhone MobilePhone PagerPhone
                 FreeformContactInfo Comments Signature Lang
-                ExternalContactInfoId ContactInfoSystem
-                ExternalAuthId AuthSystem Privileged Disabled);
+                Privileged Disabled);
 my %fields = map { lc $_ => $_ } @fields;
 
 if ($id ne 'new') {
diff --git a/share/html/User/Prefs.html b/share/html/User/Prefs.html
index bdc5b4f..c15fd68 100644
--- a/share/html/User/Prefs.html
+++ b/share/html/User/Prefs.html
@@ -226,8 +226,7 @@ else {
     my @fields = qw(
         Name Comments Signature EmailAddress FreeformContactInfo 
         Organization RealName NickName Lang
-        ExternalContactInfoId ContactInfoSystem Gecos ExternalAuthId 
-        AuthSystem HomePhone WorkPhone MobilePhone PagerPhone Address1
+        HomePhone WorkPhone MobilePhone PagerPhone Address1
         Address2 City State Zip Country Timezone
     );
 
@@ -287,11 +286,7 @@ $SetPrivileged => undef
 $Enabled => undef
 $SetEnabled => undef
 $Lang  => undef
-$ExternalContactInfoId  => undef
-$ContactInfoSystem  => undef
 $Gecos => undef
-$ExternalAuthId  => undef
-$AuthSystem  => undef
 $HomePhone => undef
 $WorkPhone  => undef
 $MobilePhone  => undef

commit e5f8c8eaa7fd19625b1d67540aea378fe55ee5b3
Author: Alex Vandiver <alexmv at bestpractical.com>
Date:   Thu Dec 5 13:22:33 2013 -0500

    Drop never-used PGPKey column on users
    
    While we may in the future want a non-Attribute store for PGP keys, it
    will most likely need to be many-to-one, and will want to be free of any
    baggage which local customizations of previous versions may have slipped
    in.

diff --git a/etc/schema.Oracle b/etc/schema.Oracle
index e74a05f..f4b809f 100755
--- a/etc/schema.Oracle
+++ b/etc/schema.Oracle
@@ -237,7 +237,6 @@ CREATE TABLE Users (
         Zip                     VARCHAR2(16),
         Country                 VARCHAR2(50),
         Timezone                VARCHAR2(50),
-        PGPKey                  CLOB,
         SMIMECertificate        CLOB,
         Creator                 NUMBER(11,0) DEFAULT 0 NOT NULL,
         Created                 DATE,
diff --git a/etc/schema.Pg b/etc/schema.Pg
index 47c8cc2..f1acc57 100755
--- a/etc/schema.Pg
+++ b/etc/schema.Pg
@@ -376,7 +376,6 @@ CREATE TABLE Users (
   Zip varchar(16) NULL  ,
   Country varchar(50) NULL  ,
   Timezone varchar(50) NULL  ,
-  PGPKey text NULL,
   SMIMECertificate text NULL,
 
   Creator integer NOT NULL DEFAULT 0  ,
diff --git a/etc/schema.SQLite b/etc/schema.SQLite
index 6f63ae4..af7533c 100755
--- a/etc/schema.SQLite
+++ b/etc/schema.SQLite
@@ -262,7 +262,6 @@ CREATE TABLE Users (
   Zip varchar(16) collate NOCASE NULL  ,
   Country varchar(50) collate NOCASE NULL  ,
   Timezone char(50) NULL  ,
-  PGPKey text collate NOCASE NULL,
   SMIMECertificate text collate NOCASE NULL,
 
   Creator integer NULL DEFAULT 0 ,
diff --git a/etc/schema.mysql b/etc/schema.mysql
index 94dfe03..48fb4c9 100755
--- a/etc/schema.mysql
+++ b/etc/schema.mysql
@@ -245,7 +245,6 @@ CREATE TABLE Users (
   Zip varchar(16) NULL  ,
   Country varchar(50) NULL  ,
   Timezone varchar(50) NULL  ,
-  PGPKey text NULL,
   SMIMECertificate text NULL,
 
   Creator integer NOT NULL DEFAULT 0  ,
diff --git a/etc/upgrade/4.3.0/schema.Oracle b/etc/upgrade/4.3.0/schema.Oracle
index 47795d3..4f31a35 100644
--- a/etc/upgrade/4.3.0/schema.Oracle
+++ b/etc/upgrade/4.3.0/schema.Oracle
@@ -3,4 +3,5 @@ ALTER TABLE Tickets
 
 ALTER TABLE Users
   DROP (EmailEncoding, WebEncoding,
-        ExternalContactInfoId, ContactInfoSystem, ExternalAuthId, AuthSystem);
+        ExternalContactInfoId, ContactInfoSystem, ExternalAuthId, AuthSystem,
+        PGPKey);
diff --git a/etc/upgrade/4.3.0/schema.Pg b/etc/upgrade/4.3.0/schema.Pg
index 6dd7bc9..ef2c27f 100644
--- a/etc/upgrade/4.3.0/schema.Pg
+++ b/etc/upgrade/4.3.0/schema.Pg
@@ -8,4 +8,5 @@ ALTER TABLE Users
   DROP COLUMN ExternalContactInfoId,
   DROP COLUMN ContactInfoSystem,
   DROP COLUMN ExternalAuthId,
-  DROP COLUMN AuthSystem;
+  DROP COLUMN AuthSystem,
+  DROP COLUMN PGPKey;
diff --git a/etc/upgrade/4.3.0/schema.mysql b/etc/upgrade/4.3.0/schema.mysql
index 6dd7bc9..ef2c27f 100644
--- a/etc/upgrade/4.3.0/schema.mysql
+++ b/etc/upgrade/4.3.0/schema.mysql
@@ -8,4 +8,5 @@ ALTER TABLE Users
   DROP COLUMN ExternalContactInfoId,
   DROP COLUMN ContactInfoSystem,
   DROP COLUMN ExternalAuthId,
-  DROP COLUMN AuthSystem;
+  DROP COLUMN AuthSystem,
+  DROP COLUMN PGPKey;
diff --git a/etc/upgrade/upgrade-mysql-schema.pl b/etc/upgrade/upgrade-mysql-schema.pl
index 9a0207e..5ac8338 100755
--- a/etc/upgrade/upgrade-mysql-schema.pl
+++ b/etc/upgrade/upgrade-mysql-schema.pl
@@ -257,7 +257,6 @@ my %charset = (
         Zip  => 'utf8',
         Country  => 'utf8',
         Timezone  => 'ascii',
-        PGPKey  => 'binary',
     },
 );
 
diff --git a/lib/RT/User.pm b/lib/RT/User.pm
index 45aa570..ddd905a 100644
--- a/lib/RT/User.pm
+++ b/lib/RT/User.pm
@@ -97,7 +97,6 @@ sub _OverlayAccessible {
           NickName              => { public => 1 },
           Lang                  => { public => 1 },
           Gecos                 => { public => 1,  admin => 1 },
-          PGPKey                => { public => 1,  admin => 1 },
           SMIMECertificate      => { public => 1,  admin => 1 },
           PrivateKey            => {               admin => 1 },
           City                  => { public => 1 },
@@ -1956,7 +1955,6 @@ Create takes a hash of values and creates a row in the database:
   varchar(16) 'Zip'.
   varchar(50) 'Country'.
   varchar(50) 'Timezone'.
-  text 'PGPKey'.
 
 =cut
 
@@ -2386,24 +2384,6 @@ Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
 =cut
 
 
-=head2 PGPKey
-
-Returns the current value of PGPKey. 
-(In the database, PGPKey is stored as text.)
-
-
-
-=head2 SetPGPKey VALUE
-
-
-Set PGPKey to VALUE. 
-Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
-(In the database, PGPKey will be stored as a text.)
-
-
-=cut
-
-
 =head2 SMIMECertificate
 
 Returns the current value of SMIMECertificate. 
@@ -2510,8 +2490,6 @@ sub _CoreAccessible {
         {read => 1, write => 1, sql_type => 12, length => 50,  is_blob => 0,  is_numeric => 0,  type => 'varchar(50)', default => ''},
         Timezone => 
         {read => 1, write => 1, sql_type => 12, length => 50,  is_blob => 0,  is_numeric => 0,  type => 'varchar(50)', default => ''},
-        PGPKey => 
-        {read => 1, write => 1, sql_type => -4, length => 0,  is_blob => 1,  is_numeric => 0,  type => 'text', default => ''},
         SMIMECertificate =>
         {read => 1, write => 1, sql_type => -4, length => 0,  is_blob => 1,  is_numeric => 0,  type => 'text', default => ''},
         Creator => 
diff --git a/share/html/Admin/Users/index.html b/share/html/Admin/Users/index.html
index acc0d11..3658488 100644
--- a/share/html/Admin/Users/index.html
+++ b/share/html/Admin/Users/index.html
@@ -139,7 +139,7 @@ my %sorted = map { $_ => $i++ } qw(
 );
 
 my @attrs = sort { $sorted{$a} <=> $sorted{$b} }
-            grep { !/(?:^id$|ContactInfo|PGPKey|AuthToken|^Last|^Creat(?:ed|or)$|^Signature$)/ }
+            grep { !/(?:^id$|ContactInfo|AuthToken|^Last|^Creat(?:ed|or)$|^Signature$)/ }
             RT::User->ReadableAttributes;
 my @fields;
 

commit 04ffee6202af1bdd6488fe2def3a439d174c8000
Author: Shawn M Moore <shawn at bestpractical.com>
Date:   Fri May 15 21:20:05 2015 +0000

    Bail out if a column we'll drop has any values
    
        The last thing I want is an angry email saying we dropped a
        column filled with irreplaceable data

diff --git a/etc/upgrade/4.3.0/content b/etc/upgrade/4.3.0/content
new file mode 100644
index 0000000..c55b278
--- /dev/null
+++ b/etc/upgrade/4.3.0/content
@@ -0,0 +1,54 @@
+use strict;
+use warnings;
+
+our @Initial = (
+    sub {
+        RT->Logger->debug('Make sure all columns we are about to drop are empty');
+
+        # Tickets
+        for my $column (qw/IssueStatement Resolution/) {
+            my $tickets = RT::Tickets->new(RT->SystemUser);
+            $tickets->Limit(
+                FIELD           => $column,
+                OPERATOR        => '!=',
+                VALUE           => 0,
+                ENTRYAGGREGATOR => 'AND',
+            );
+            $tickets->Limit(
+                FIELD           => $column,
+                OPERATOR        => 'IS NOT',
+                VALUE           => 'NULL',
+                ENTRYAGGREGATOR => 'AND',
+            );
+
+            if ($tickets->Count) {
+                die "You have " . $tickets->Count . " ticket(s) with a non-empty value for column '$column'. Core RT does not use this column, so perhaps an extension or local modification makes use of it. Please migrate these ticket values to a custom field or an attribute.";
+            }
+        }
+
+        # Users
+        for my $column (qw/
+            EmailEncoding WebEncoding ExternalContactInfoId
+            ContactInfoSystem ExternalAuthId AuthSystem PGPKey
+        /) {
+            my $users = RT::Users->new(RT->SystemUser);
+            $users->Limit(
+                FIELD           => $column,
+                OPERATOR        => '!=',
+                VALUE           => '',
+                ENTRYAGGREGATOR => 'AND',
+            );
+            $users->Limit(
+                FIELD           => $column,
+                OPERATOR        => 'IS NOT',
+                VALUE           => 'NULL',
+                ENTRYAGGREGATOR => 'AND',
+            );
+
+            if ($users->Count) {
+                die "You have " . $users->Count . " users(s) with a non-empty value for column '$column'. Core RT does not use this column, so perhaps an extension or local modification makes use of it. Please migrate these user values to a custom field or an attribute.";
+            }
+        }
+    },
+);
+

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


More information about the rt-commit mailing list