summaryrefslogtreecommitdiff
path: root/rt/etc
diff options
context:
space:
mode:
authorivan <ivan>2005-10-15 09:11:20 +0000
committerivan <ivan>2005-10-15 09:11:20 +0000
commitd4d0590bef31071e8809ec046717444b95b3f30a (patch)
treeee1236da50578390d2642114f28eaed99a5efb18 /rt/etc
parentd39d52aac8f38ea9115628039f0df5aa3ac826de (diff)
import rt 3.4.4
Diffstat (limited to 'rt/etc')
-rw-r--r--rt/etc/RT_Config.pm.in100
-rw-r--r--rt/etc/RT_SiteConfig.pm18
-rwxr-xr-xrt/etc/acl.Pg36
-rwxr-xr-xrt/etc/acl.mysql1
-rw-r--r--rt/etc/initialdata4
-rw-r--r--rt/etc/schema.Informix15
-rw-r--r--rt/etc/schema.Oracle53
-rwxr-xr-xrt/etc/schema.Pg68
-rw-r--r--rt/etc/schema.SQLite101
-rwxr-xr-xrt/etc/schema.mysql49
-rwxr-xr-xrt/etc/upgrade/3.1.0/schema.Pg2
-rw-r--r--rt/etc/upgrade/3.1.0/schema.SQLite3
-rw-r--r--rt/etc/upgrade/3.3.0/acl.Informix4
-rw-r--r--rt/etc/upgrade/3.3.0/acl.Oracle4
-rw-r--r--rt/etc/upgrade/3.3.0/acl.Pg20
-rw-r--r--rt/etc/upgrade/3.3.0/acl.SQLite4
-rw-r--r--rt/etc/upgrade/3.3.0/acl.mysql4
-rw-r--r--rt/etc/upgrade/3.3.0/content1
-rw-r--r--rt/etc/upgrade/3.3.0/schema.Oracle65
-rw-r--r--rt/etc/upgrade/3.3.0/schema.Pg74
-rw-r--r--rt/etc/upgrade/3.3.0/schema.mysql65
-rw-r--r--rt/etc/upgrade/3.3.11/acl.Oracle4
-rw-r--r--rt/etc/upgrade/3.3.11/acl.Pg4
-rw-r--r--rt/etc/upgrade/3.3.11/acl.SQLite4
-rw-r--r--rt/etc/upgrade/3.3.11/acl.mysql4
-rw-r--r--rt/etc/upgrade/3.3.11/content1
-rw-r--r--rt/etc/upgrade/3.3.11/schema.Oracle0
-rw-r--r--rt/etc/upgrade/3.3.11/schema.Pg11
-rw-r--r--rt/etc/upgrade/3.3.11/schema.SQLite0
-rw-r--r--rt/etc/upgrade/3.3.11/schema.mysql5
30 files changed, 605 insertions, 119 deletions
diff --git a/rt/etc/RT_Config.pm.in b/rt/etc/RT_Config.pm.in
index 7f967061d..773e3e2dc 100644
--- a/rt/etc/RT_Config.pm.in
+++ b/rt/etc/RT_Config.pm.in
@@ -17,7 +17,7 @@ use RT::Config;
# {{{ Base Configuration
-# $rtname the string that RT will look for in mail messages to
+# $rtname is the string that RT will look for in mail messages to
# figure out what ticket a new piece of mail belongs to
# Your domain name is recommended, so as not to pollute the namespace.
@@ -26,6 +26,28 @@ use RT::Config;
Set($rtname , "example.com");
+
+# This regexp controls what subject tags RT recognizes as its own.
+# If you're not dealing with historical $rtname values, you'll likely
+# never have to enable this feature.
+#
+# Be VERY CAREFUL with it. Note that it overrides $rtname for subject
+# token matching and that you should use only "non-capturing" parenthesis
+# grouping. For example:
+#
+# Set($EmailSubjectTagRegex, qr/(?:example.com|example.org)/ );
+#
+# and NOT
+#
+# Set($EmailSubjectTagRegex, qr/(example.com|example.org)/ );
+#
+# This setting would make RT behave exactly as it does without the
+# setting enabled.
+#
+# Set($EmailSubjectTagRegex, qr/\Q$rtname\E/ );
+
+
+
# You should set this to your organization's DNS domain. For example,
# fsck.com or asylum.arkham.ma.us. It's used by the linking interface to
# guarantee that ticket URIs are unique and easy to construct.
@@ -87,7 +109,7 @@ Set($OwnerEmail , 'root');
Set($LoopsToRTOwner , 1);
-# If $StoreLoopss is defined, RT will record messages that it believes
+# If $StoreLoops is defined, RT will record messages that it believes
# to be part of mail loops.
# As it does this, it will try to be careful not to send mail to the
# sender of these messages
@@ -104,12 +126,12 @@ Set($StoreLoops , undef);
Set($MaxAttachmentSize , 10000000);
# $TruncateLongAttachments: if this is set to a non-undef value,
-# RT will truncate attachments longer than MaxAttachmentLength.
+# RT will truncate attachments longer than MaxAttachmentSize.
Set($TruncateLongAttachments , undef);
# $DropLongAttachments: if this is set to a non-undef value,
-# RT will silently drop attachments longer than MaxAttachmentLength.
+# RT will silently drop attachments longer than MaxAttachmentSize.
Set($DropLongAttachments , undef);
@@ -133,8 +155,8 @@ Set($RTAddressRegexp , '^rt\@example.com$');
# (These values are passed to the CanonicalizeEmailAddress subroutine in RT/User.pm)
# By default, that routine performs a s/$Match/$Replace/gi on any address passed to it
-Set($CanonicalizeEmailAddressMatch , 'subdomain.example.com$');
-Set($CanonicalizeEmailAddressReplace , 'example.com');
+#Set($CanonicalizeEmailAddressMatch , '@subdomain\.example\.com$');
+#Set($CanonicalizeEmailAddressReplace , '@example.com');
# set this to true and the create new user page will use the values that you
# enter in the form but use the function CanonicalizeUserInfo in User_Local.pm
@@ -177,7 +199,7 @@ Set($CommentAddress , 'RT_CommentAddressNotSet');
# If 'sendmailpipe' doesn't work well for you, try 'sendmail'
#
# Note that you should remove the '-t' from $SendmailArguments
-# if you use 'sendmail rather than 'sendmailpipe'
+# if you use 'sendmail' rather than 'sendmailpipe'
Set($MailCommand , 'sendmailpipe');
@@ -276,7 +298,7 @@ Set($WebPath , "");
# This is the Scheme, server and port for constructing urls to webrt
# $WebBaseURL doesn't need a trailing /
-Set($WebBaseURL , "http://RT::WebBaseURL.not.configured:80");
+Set($WebBaseURL , "http://localhost");
Set($WebURL , $WebBaseURL . $WebPath . "/");
@@ -284,9 +306,9 @@ Set($WebURL , $WebBaseURL . $WebPath . "/");
Set($WebImagesURL , $WebPath . "/NoAuth/images/");
-# $RTLogoURL points to the URL of the RT logo displayed in the web UI
+# $LogoURL points to the URL of the RT logo displayed in the web UI
-Set($LogoURL , $WebImagesURL . "rt.jpg");
+Set($LogoURL , $WebImagesURL . "bplogo.gif");
# WebNoAuthRegex - What portion of RT's URLspace should not require
# authentication.
@@ -307,12 +329,18 @@ Set($MessageBoxWrap, "HARD");
# sent in a request (although there is probably more to it than that)
Set($TrustHTMLAttachments , undef);
+# Should RT redistribute correspondence that it identifies as
+# machine generated? A true value (the default) will do so, setting
+# this to '0' will cause no such messages to be redistributed.
+# You can also use 'privileged', which will redistribute only to
+# privileged users. This is seful if you get malformed bounces caused by
+# autocreated requestors with bogus addresses.
+Set($RedistributeAutoGeneratedMessages, 1);
# If PreferRichText is set to a true value, RT will show HTML/Rich text
# messages in preference to their plaintext alternatives. RT "scrubs" the
# html to show only a minimal subset of HTML to avoid possible contamination
# by cross-site-scripting attacks.
-
Set($PreferRichText, undef);
# If $WebExternalAuth is defined, RT will defer to the environment's
@@ -342,6 +370,16 @@ Set($WebExternalAuto , undef);
# Set($WebSessionClass , 'Apache::Session::File');
+# By default, RT clears its database cache after every page view.
+# This ensures that you've always got the most current information
+# when working in a multi-process (mod_perl or FastCGI) Environment
+# Setting $WebFlushDbCacheEveryRequest to '0' will turn this off,
+# which will speed RT up a bit, at the expense of a tiny bit of data
+# accuracy
+
+Set($WebFlushDbCacheEveryRequest, '1');
+
+
# $MaxInlineBody is the maximum attachment size that we want to see
# inline when viewing a transaction. 13456 is a random sane-sounding
# default.
@@ -362,8 +400,9 @@ Set($MyRequestsLength, 10);
# @MasonParameters is the list of parameters for the constructor of
# HTML::Mason's Apache or CGI Handler. This is normally only useful
-# for debugging, eg. profiling individual components with
-# (preamble => 'my $p = MasonX::Profiler->new($m, $r);');
+# for debugging, eg. profiling individual components with:
+# use MasonX::Profiler; # available on CPAN
+# @MasonParameters = (preamble => 'my $p = MasonX::Profiler->new($m, $r);');
@MasonParameters = () unless (@MasonParameters);
@@ -389,8 +428,8 @@ Set ($DefaultSearchResultFormat, qq{
# {{{ RT UTF-8 Settings
# An array that contains languages supported by RT's internationalization
-# interface. Defaults to all *.po lexicons; set it to qw(en ja) will make
-# RT bilingual instead of multilingual, but will save same memory.
+# interface. Defaults to all *.po lexicons; setting it to qw(en ja) will make
+# RT bilingual instead of multilingual, but will save some memory.
@LexiconLanguages = qw(*) unless (@LexiconLanguages);
@@ -420,4 +459,35 @@ Set($AmbiguousDayInPast , 1);
# }}}
+# {{{ Miscellaneous RT Settings
+
+# You can define new statuses and even reorder existing statuses here.
+# WARNING. DO NOT DELETE ANY OF THE DEFAULT STATUSES. If you do, RT
+# will break horribly.
+
+@ActiveStatus = qw(new open stalled) unless @ActiveStatus;
+@InactiveStatus = qw(resolved rejected deleted) unless @InactiveStatus;
+
+# }}}
+
+
+# {{{ Development Mode
+#
+# RT comes with a "Development mode" setting.
+# This setting, as a convenience for developers, turns on
+# all sorts of development options that you most likely don't want in
+# production:
+#
+# * Turns off Mason's 'static_source' directive. By default, you can't
+# edit RT's web ui components on the fly and have RT magically pick up
+# your changes. (It's a big performance hit)
+#
+# * More to come
+#
+
+Set($DevelMode, '@RT_DEVEL_MODE@');
+
+# }}}
+
+
1;
diff --git a/rt/etc/RT_SiteConfig.pm b/rt/etc/RT_SiteConfig.pm
index 0afc6045c..39c99161f 100644
--- a/rt/etc/RT_SiteConfig.pm
+++ b/rt/etc/RT_SiteConfig.pm
@@ -1 +1,19 @@
+# Any configuration directives you include here will override
+# RT's default configuration file, RT_Config.pm
+#
+# To include a directive here, just copy the equivalent statement
+# from RT_Config.pm and change the value. We've included a single
+# sample value below.
+#
+# This file is actually a perl module, so you can include valid
+# perl code, as well.
+#
+# The converse is also true, if this file isn't valid perl, you're
+# going to run into trouble. To check your SiteConfig file, use
+# this comamnd:
+#
+# perl -c /path/to/your/etc/RT_SiteConfig.pm
+
+Set( $rtname, 'example.com');
+
1;
diff --git a/rt/etc/acl.Pg b/rt/etc/acl.Pg
index 49f938e4f..fb625592d 100755
--- a/rt/etc/acl.Pg
+++ b/rt/etc/acl.Pg
@@ -10,37 +10,39 @@ sub acl {
Attributes
attributes_id_seq
queues_id_seq
- Queues
+ Queues
links_id_seq
- Links
+ Links
principals_id_seq
- Principals
+ Principals
groups_id_seq
- Groups
+ Groups
scripconditions_id_seq
- ScripConditions
+ ScripConditions
transactions_id_seq
- Transactions
+ Transactions
scrips_id_seq
- Scrips
+ Scrips
acl_id_seq
- ACL
+ ACL
groupmembers_id_seq
- GroupMembers
+ GroupMembers
cachedgroupmembers_id_seq
- CachedGroupMembers
+ CachedGroupMembers
users_id_seq
- Users
+ Users
tickets_id_seq
- Tickets
+ Tickets
scripactions_id_seq
- ScripActions
+ ScripActions
templates_id_seq
- Templates
- ticketcustomfieldvalues_id_s
- TicketCustomFieldValues
+ Templates
+ objectcustomfieldvalues_id_s
+ ObjectCustomFieldValues
customfields_id_seq
- CustomFields
+ CustomFields
+ objectcustomfields_id_s
+ ObjectCustomFields
customfieldvalues_id_seq
CustomFieldValues
sessions
diff --git a/rt/etc/acl.mysql b/rt/etc/acl.mysql
index 5bd883472..621ef121c 100755
--- a/rt/etc/acl.mysql
+++ b/rt/etc/acl.mysql
@@ -1,4 +1,5 @@
sub acl {
+return () if !$RT::DatabaseUser or $RT::DatabaseUser eq 'root';
return (
"USE mysql;",
"DELETE FROM user WHERE user = '${RT::DatabaseUser}';",
diff --git a/rt/etc/initialdata b/rt/etc/initialdata
index d5d3b2022..3a21ce1f6 100644
--- a/rt/etc/initialdata
+++ b/rt/etc/initialdata
@@ -351,7 +351,7 @@ batch-process all your pending approvals.
Name => "Approval Passed", # loc
Description =>
"Notify Owner of their ticket has been approved by some approver", # loc
- Content => 'Subject: Ticket Rejected: {$Ticket->Subject}
+ Content => 'Subject: Ticket Approved: {$Ticket->Subject}
Greetings,
@@ -363,7 +363,7 @@ Other approvals may be pending.
Name => "All Approvals Passed", # loc
Description =>
"Notify Owner of their ticket has been approved by all approvers", # loc
- Content => 'Subject: Ticket Rejected: {$Ticket->Subject}
+ Content => 'Subject: Ticket Approved: {$Ticket->Subject}
Greetings,
diff --git a/rt/etc/schema.Informix b/rt/etc/schema.Informix
index 20c607e85..6a4e5334e 100644
--- a/rt/etc/schema.Informix
+++ b/rt/etc/schema.Informix
@@ -103,20 +103,22 @@ CREATE TABLE ScripConditions (
CREATE TABLE Transactions (
id SERIAL,
- EffectiveTicket INTEGER DEFAULT 0 NOT NULL,
- Ticket INTEGER DEFAULT 0 NOT NULL,
+ ObjectType VARCHAR(255),
+ ObjectId INTEGER DEFAULT 0 NOT NULL,
TimeTaken INTEGER DEFAULT 0 NOT NULL,
Type VARCHAR(20),
Field VARCHAR(40),
OldValue VARCHAR(255),
NewValue VARCHAR(255),
+ ReferenceType VARCHAR(255),
+ OldReference INTEGER DEFAULT 0,
+ NewReference INTEGER DEFAULT 0,
Data VARCHAR(255),
Creator INTEGER DEFAULT 0 NOT NULL,
Created DATETIME YEAR TO SECOND,
PRIMARY KEY (id)
);
-CREATE INDEX Transactions1 ON Transactions (Ticket);
-CREATE INDEX Transactions2 ON Transactions (EffectiveTicket);
+CREATE INDEX Transactions1 ON Transactions (ObjectType, ObjectId);
CREATE TABLE Scrips (
@@ -305,7 +307,9 @@ CREATE TABLE CustomFields (
id SERIAL,
Name VARCHAR(200),
Type VARCHAR(200),
- Queue INTEGER DEFAULT 0 NOT NULL,
+ MaxValues INTEGER DEFAULT 0 NOT NULL,
+ Pattern VARCHAR(255),
+ LookupType VARCHAR(255),
Description VARCHAR(255),
SortOrder INTEGER DEFAULT 0 NOT NULL,
Creator INTEGER DEFAULT 0 NOT NULL,
@@ -315,7 +319,6 @@ CREATE TABLE CustomFields (
Disabled SMALLINT DEFAULT 0 NOT NULL,
PRIMARY KEY (id)
);
-CREATE INDEX CustomFields1 ON CustomFields (Disabled, Queue);
CREATE TABLE CustomFieldValues (
diff --git a/rt/etc/schema.Oracle b/rt/etc/schema.Oracle
index 9b53cf7ac..40238b526 100644
--- a/rt/etc/schema.Oracle
+++ b/rt/etc/schema.Oracle
@@ -1,3 +1,4 @@
+
CREATE SEQUENCE ATTACHMENTS_seq;
CREATE TABLE Attachments (
id NUMBER(11,0)
@@ -105,19 +106,21 @@ CREATE SEQUENCE TRANSACTIONS_seq;
CREATE TABLE Transactions (
id NUMBER(11,0)
CONSTRAINT Transactions_Key PRIMARY KEY,
- EffectiveTicket NUMBER(11,0) DEFAULT 0 NOT NULL,
- Ticket NUMBER(11,0) DEFAULT 0 NOT NULL,
+ ObjectType VARCHAR2(255),
+ ObjectId NUMBER(11,0) DEFAULT 0 NOT NULL,
TimeTaken NUMBER(11,0) DEFAULT 0 NOT NULL,
Type VARCHAR2(20),
Field VARCHAR2(40),
OldValue VARCHAR2(255),
NewValue VARCHAR2(255),
+ ReferenceType VARCHAR2(255),
+ OldReference NUMBER(11,0),
+ NewReference NUMBER(11,0),
Data VARCHAR2(255),
Creator NUMBER(11,0) DEFAULT 0 NOT NULL,
Created DATE
);
-CREATE INDEX Transactions1 ON Transactions (Ticket);
-CREATE INDEX Transactions2 ON Transactions (EffectiveTicket);
+CREATE INDEX Transactions1 ON Transactions (ObjectType, ObjectId);
CREATE SEQUENCE SCRIPS_seq;
@@ -295,21 +298,43 @@ CREATE TABLE Templates (
);
-CREATE SEQUENCE TICKETCUSTOMFIELDVALUES_seq;
-CREATE TABLE TicketCustomFieldValues (
+CREATE SEQUENCE OBJECTCUSTOMFIELDS_seq;
+CREATE TABLE ObjectCustomFields (
+ id NUMBER(11,0)
+ CONSTRAINT ObjectCustomFields_Key PRIMARY KEY,
+ CustomField NUMBER(11,0) NOT NULL,
+ ObjectId NUMBER(11,0) NOT NULL,
+ SortOrder NUMBER(11,0) DEFAULT 0 NOT NULL,
+ Creator NUMBER(11,0) DEFAULT 0 NOT NULL,
+ Created DATE,
+ LastUpdatedBy NUMBER(11,0) DEFAULT 0 NOT NULL,
+ LastUpdated DATE
+);
+
+
+CREATE SEQUENCE OBJECTCUSTOMFIELDVALUES_seq;
+CREATE TABLE ObjectCustomFieldValues (
id NUMBER(11,0)
- CONSTRAINT TicketCustomFieldValues_Key PRIMARY KEY,
- Ticket NUMBER(11,0),
+ CONSTRAINT ObjectCustomFieldValues_Key PRIMARY KEY,
CustomField NUMBER(11,0) NOT NULL,
+ ObjectType VARCHAR2(25) NOT NULL,
+ ObjectId NUMBER(11,0) DEFAULT 0 NOT NULL,
+ SortOrder NUMBER(11,0) DEFAULT 0 NOT NULL,
+
Content VARCHAR2(255),
+ LargeContent CLOB,
+ ContentType VARCHAR2(80),
+ ContentEncoding VARCHAR2(80),
+
Creator NUMBER(11,0) DEFAULT 0 NOT NULL,
Created DATE,
LastUpdatedBy NUMBER(11,0) DEFAULT 0 NOT NULL,
- LastUpdated DATE
+ LastUpdated DATE,
+ Disabled NUMBER(11,0) DEFAULT 0 NOT NULL
);
-CREATE INDEX TicketCustomFieldValues1 ON TicketCustomFieldValues (CustomField,Ticket,Content);
-CREATE INDEX TicketCustomFieldValues2 ON TicketCustomFieldValues (CustomField,Ticket);
+CREATE INDEX ObjectCustomFieldValues1 ON ObjectCustomFieldValues (Content);
+CREATE INDEX ObjectCustomFieldValues2 ON ObjectCustomFieldValues (CustomField,ObjectType,ObjectId);
CREATE SEQUENCE CUSTOMFIELDS_seq;
CREATE TABLE CustomFields (
@@ -317,16 +342,18 @@ CREATE TABLE CustomFields (
CONSTRAINT CustomFields_Key PRIMARY KEY,
Name VARCHAR2(200),
Type VARCHAR2(200),
- Queue NUMBER(11,0) DEFAULT 0 NOT NULL,
+ MaxValues NUMBER(11,0) DEFAULT 0 NOT NULL,
+ Pattern VARCHAR2(255),
+ Repeated NUMBER(11,0) DEFAULT 0 NOT NULL,
Description VARCHAR2(255),
SortOrder NUMBER(11,0) DEFAULT 0 NOT NULL,
+ LookupType VARCHAR2(255),
Creator NUMBER(11,0) DEFAULT 0 NOT NULL,
Created DATE,
LastUpdatedBy NUMBER(11,0) DEFAULT 0 NOT NULL,
LastUpdated DATE,
Disabled NUMBER(11,0) DEFAULT 0 NOT NULL
);
-CREATE INDEX CustomFields1 ON CustomFields (Disabled, Queue);
CREATE SEQUENCE CUSTOMFIELDVALUES_seq;
diff --git a/rt/etc/schema.Pg b/rt/etc/schema.Pg
index a5b68b395..2d45a946a 100755
--- a/rt/etc/schema.Pg
+++ b/rt/etc/schema.Pg
@@ -57,7 +57,7 @@ CREATE TABLE Queues (
Created TIMESTAMP NULL ,
LastUpdatedBy integer NOT NULL DEFAULT 0 ,
LastUpdated TIMESTAMP NULL ,
- Disabled int2 NOT NULL DEFAULT 0 ,
+ Disabled integer NOT NULL DEFAULT 0 ,
PRIMARY KEY (id)
);
@@ -108,7 +108,7 @@ CREATE TABLE Principals (
id INTEGER DEFAULT nextval('principals_id_seq') not null,
PrincipalType VARCHAR(16) not null,
ObjectId integer,
- Disabled int2 NOT NULL DEFAULT 0 ,
+ Disabled integer NOT NULL DEFAULT 0 ,
PRIMARY KEY (id)
);
@@ -183,13 +183,16 @@ CREATE SEQUENCE transactions_id_seq;
CREATE TABLE Transactions (
id INTEGER DEFAULT nextval('transactions_id_seq'),
- EffectiveTicket integer NOT NULL DEFAULT 0 ,
- Ticket integer NOT NULL DEFAULT 0 ,
+ ObjectType varchar(255) NOT NULL ,
+ ObjectId integer NOT NULL DEFAULT 0 ,
TimeTaken integer NOT NULL DEFAULT 0 ,
Type varchar(20) NULL ,
Field varchar(40) NULL ,
OldValue varchar(255) NULL ,
NewValue varchar(255) NULL ,
+ ReferenceType varchar(255) NULL,
+ OldReference integer NULL ,
+ NewReference integer NULL ,
Data varchar(255) NULL ,
Creator integer NOT NULL DEFAULT 0 ,
@@ -197,8 +200,7 @@ CREATE TABLE Transactions (
PRIMARY KEY (id)
);
-CREATE INDEX Transactions1 ON Transactions (Ticket);
-CREATE INDEX Transactions2 ON Transactions (EffectiveTicket);
+CREATE INDEX Transactions1 ON Transactions (ObjectType, ObjectId);
-- }}}
@@ -299,7 +301,7 @@ CREATE TABLE CachedGroupMembers (
MemberId int,
Via int,
ImmediateParentId int,
- Disabled int2 NOT NULL DEFAULT 0 ,
+ Disabled integer NOT NULL DEFAULT 0 ,
PRIMARY KEY (id)
);
@@ -406,7 +408,7 @@ CREATE TABLE Tickets (
LastUpdated TIMESTAMP NULL ,
Creator integer NOT NULL DEFAULT 0 ,
Created TIMESTAMP NULL ,
- Disabled int2 NOT NULL DEFAULT 0 ,
+ Disabled integer NOT NULL DEFAULT 0 ,
PRIMARY KEY (id)
);
@@ -474,7 +476,7 @@ CREATE TABLE Templates (
-- }}}
--- {{{ TicketCustomFieldValues
+-- {{{ ObjectCustomFieldValues
@@ -482,24 +484,31 @@ CREATE TABLE Templates (
-- Sequences for table TICKETCUSTOMFIELDVALUES
--
-CREATE SEQUENCE ticketcustomfieldvalues_id_s;
+CREATE SEQUENCE objectcustomfieldvalues_id_s;
-CREATE TABLE TicketCustomFieldValues (
- id INTEGER DEFAULT nextval('ticketcustomfieldvalues_id_s'),
- Ticket int NOT NULL ,
+CREATE TABLE ObjectCustomFieldValues (
+ id INTEGER DEFAULT nextval('objectcustomfieldvalues_id_s'),
CustomField int NOT NULL ,
+ ObjectType varchar(255) NULL ,
+ ObjectId int NOT NULL ,
+ SortOrder integer NOT NULL DEFAULT 0 ,
+
Content varchar(255) NULL ,
+ LargeContent text NULL,
+ ContentType varchar(80) NULL,
+ ContentEncoding varchar(80) NULL ,
Creator integer NOT NULL DEFAULT 0 ,
Created TIMESTAMP NULL ,
LastUpdatedBy integer NOT NULL DEFAULT 0 ,
LastUpdated TIMESTAMP NULL ,
+ Disabled integer NOT NULL DEFAULT 0 ,
PRIMARY KEY (id)
);
-CREATE INDEX TicketCustomFieldValues1 ON TicketCustomFieldValues (CustomField,Ticket,Content);
-CREATE INDEX TicketCustomFieldValues2 ON TicketCustomFieldValues (CustomField,Ticket);
+CREATE INDEX ObjectCustomFieldValues1 ON ObjectCustomFieldValues (CustomField,ObjectType,ObjectId,Content);
+CREATE INDEX ObjectCustomFieldValues2 ON ObjectCustomFieldValues (CustomField,ObjectType,ObjectId);
-- }}}
@@ -517,7 +526,10 @@ CREATE TABLE CustomFields (
id INTEGER DEFAULT nextval('customfields_id_seq'),
Name varchar(200) NULL ,
Type varchar(200) NULL ,
- Queue integer NOT NULL DEFAULT 0 ,
+ MaxValues integer NOT NULL DEFAULT 0 ,
+ Repeated integer NOT NULL DEFAULT 0 ,
+ Pattern varchar(255) NULL ,
+ LookupType varchar(255) NOT NULL ,
Description varchar(255) NULL ,
SortOrder integer NOT NULL DEFAULT 0 ,
@@ -525,7 +537,27 @@ CREATE TABLE CustomFields (
Created TIMESTAMP NULL ,
LastUpdatedBy integer NOT NULL DEFAULT 0 ,
LastUpdated TIMESTAMP NULL ,
- Disabled int2 NOT NULL DEFAULT 0 ,
+ Disabled integer NOT NULL DEFAULT 0 ,
+ PRIMARY KEY (id)
+
+);
+
+-- }}}
+
+-- {{{ ObjectCustomFields
+
+CREATE SEQUENCE objectcustomfields_id_s;
+
+CREATE TABLE ObjectCustomFields (
+ id INTEGER DEFAULT nextval('objectcustomfields_id_s'),
+ CustomField integer NOT NULL,
+ ObjectId integer NOT NULL,
+ SortOrder integer NOT NULL DEFAULT 0 ,
+
+ Creator integer NOT NULL DEFAULT 0 ,
+ Created TIMESTAMP NULL ,
+ LastUpdatedBy integer NOT NULL DEFAULT 0 ,
+ LastUpdated TIMESTAMP NULL ,
PRIMARY KEY (id)
);
@@ -573,7 +605,7 @@ CREATE TABLE Attributes (
Content text,
ContentType varchar(16),
ObjectType varchar(64),
- ObjectId integer, # foreign key to anything
+ ObjectId integer,
Creator integer NOT NULL DEFAULT 0 ,
Created TIMESTAMP NULL ,
LastUpdatedBy integer NOT NULL DEFAULT 0 ,
diff --git a/rt/etc/schema.SQLite b/rt/etc/schema.SQLite
index 174664662..8791bb47e 100644
--- a/rt/etc/schema.SQLite
+++ b/rt/etc/schema.SQLite
@@ -112,21 +112,23 @@ CREATE TABLE ScripConditions (
--- {{{ Transactions
CREATE TABLE Transactions (
id INTEGER PRIMARY KEY ,
- EffectiveTicket integer NULL ,
- Ticket integer NULL ,
+ ObjectType varchar(255) NULL ,
+ ObjectId integer NULL ,
TimeTaken integer NULL ,
Type varchar(20) NULL ,
Field varchar(40) NULL ,
OldValue varchar(255) NULL ,
NewValue varchar(255) NULL ,
+ ReferenceType varchar(255) NULL ,
+ OldReference integer NULL ,
+ NewReference integer NULL ,
Data varchar(255) NULL ,
Creator integer NULL ,
Created DATETIME NULL
) ;
-CREATE INDEX Transactions1 ON Transactions (Ticket);
-CREATE INDEX Transactions2 ON Transactions (EffectiveTicket);
+CREATE INDEX Transactions1 ON Transactions (ObjectType, ObjectId);
--- }}}
@@ -329,65 +331,94 @@ CREATE TABLE Templates (
--- }}}
---- {{{ TicketCustomFieldValues
-CREATE TABLE TicketCustomFieldValues (
- id INTEGER PRIMARY KEY ,
- Ticket int NOT NULL ,
+
+# {{{ ObjectCustomFieldValues
+
+CREATE TABLE ObjectCustomFieldValues (
+ id INTEGER NOT NULL ,
CustomField int NOT NULL ,
+ ObjectType varchar(255) NOT NULL, # Final target of the Object
+ ObjectId int NOT NULL , # New -- Replaces Ticket
+ SortOrder integer NOT NULL DEFAULT 0 ,
+
Content varchar(255) NULL ,
+ LargeContent LONGTEXT NULL, # New -- to hold 255+ strings
+ ContentType varchar(80) NULL, # New -- only text/* gets searched
+ ContentEncoding varchar(80) NULL , # New -- for binary Content
- Creator integer NULL ,
+ Creator integer NOT NULL DEFAULT 0 ,
Created DATETIME NULL ,
- LastUpdatedBy integer NULL ,
- LastUpdated DATETIME NULL
-
+ LastUpdatedBy integer NOT NULL DEFAULT 0 ,
+ LastUpdated DATETIME NULL ,
+ Disabled int2 NOT NULL DEFAULT 0 ,
+ PRIMARY KEY (id)
) ;
-CREATE INDEX TicketCustomFieldValues1 ON TicketCustomFieldValues (CustomField,Ticket,Content);
-CREATE INDEX TicketCustomFieldValues2 ON TicketCustomFieldValues (CustomField,Ticket);
+CREATE INDEX ObjectCustomFieldValues1 ON ObjectCustomFieldValues (Content);
+CREATE INDEX ObjectCustomFieldValues2 ON ObjectCustomFieldValues (CustomField,ObjectType,ObjectId);
---- }}}
+# }}}
---- {{{ CustomFields
+# {{{ CustomFields
CREATE TABLE CustomFields (
- id INTEGER PRIMARY KEY ,
+ id INTEGER NOT NULL ,
Name varchar(200) NULL ,
- Type varchar(200) NULL ,
- Queue int NULL ,
+ Type varchar(200) NULL , # Changed -- 'Single' and 'Multiple' is moved out
+ MaxValues integer, # New -- was 'Single'(1) and 'Multiple'(0)
+ Pattern varchar(255) NULL , # New -- Must validate against this
+ Repeated int2 NOT NULL DEFAULT 0 , # New -- repeated table entry
Description varchar(255) NULL ,
- SortOrder integer NULL ,
+ SortOrder integer NOT NULL DEFAULT 0 ,
+ LookupType varchar(255) NOT NULL,
- Creator integer NULL ,
+ Creator integer NOT NULL DEFAULT 0 ,
Created DATETIME NULL ,
- LastUpdatedBy integer NULL ,
- LastUpdated DATETIME NULL ,
- Disabled int2 NOT NULL DEFAULT 0
-
+ LastUpdatedBy integer NOT NULL DEFAULT 0 ,
+ LastUpdated DATETIME NULL ,
+ Disabled int2 NOT NULL DEFAULT 0 ,
+ PRIMARY KEY (id)
) ;
---- }}}
+# }}}
---- {{{ CustomFieldValues
+# {{{ ObjectCustomFields
+
+CREATE TABLE ObjectCustomFields (
+ id INTEGER NOT NULL ,
+ CustomField int NOT NULL ,
+ ObjectId integer NOT NULL,
+ SortOrder integer NOT NULL DEFAULT 0 ,
+
+ Creator integer NOT NULL DEFAULT 0 ,
+ Created DATETIME NULL ,
+ LastUpdatedBy integer NOT NULL DEFAULT 0 ,
+ LastUpdated DATETIME NULL ,
+ PRIMARY KEY (id)
+) ;
+
+# }}}
+
+# {{{ CustomFieldValues
CREATE TABLE CustomFieldValues (
- id INTEGER PRIMARY KEY ,
+ id INTEGER NOT NULL ,
CustomField int NOT NULL ,
Name varchar(200) NULL ,
Description varchar(255) NULL ,
- SortOrder integer NULL ,
+ SortOrder integer NOT NULL DEFAULT 0 ,
- Creator integer NULL ,
+ Creator integer NOT NULL DEFAULT 0 ,
Created DATETIME NULL ,
- LastUpdatedBy integer NULL ,
- LastUpdated DATETIME NULL
-
+ LastUpdatedBy integer NOT NULL DEFAULT 0 ,
+ LastUpdated DATETIME NULL ,
+ PRIMARY KEY (id)
) ;
CREATE INDEX CustomFieldValues1 ON CustomFieldValues (CustomField);
-
---- }}}
+
+# }}}
--- {{{ Attributes
CREATE TABLE Attributes (
diff --git a/rt/etc/schema.mysql b/rt/etc/schema.mysql
index 0ab42e7eb..60f1abae2 100755
--- a/rt/etc/schema.mysql
+++ b/rt/etc/schema.mysql
@@ -118,21 +118,23 @@ CREATE TABLE ScripConditions (
# {{{ Transactions
CREATE TABLE Transactions (
id INTEGER NOT NULL AUTO_INCREMENT,
- EffectiveTicket integer NOT NULL DEFAULT 0 ,
- Ticket integer NOT NULL DEFAULT 0 ,
+ ObjectType varchar(64) NOT NULL,
+ ObjectId integer NOT NULL DEFAULT 0 ,
TimeTaken integer NOT NULL DEFAULT 0 ,
Type varchar(20) NULL ,
Field varchar(40) NULL ,
OldValue varchar(255) NULL ,
NewValue varchar(255) NULL ,
+ ReferenceType varchar(255) NULL,
+ OldReference integer NULL ,
+ NewReference integer NULL ,
Data varchar(255) NULL ,
Creator integer NOT NULL DEFAULT 0 ,
Created DATETIME NULL ,
PRIMARY KEY (id)
) TYPE=InnoDB;
-CREATE INDEX Transactions1 ON Transactions (Ticket);
-CREATE INDEX Transactions2 ON Transactions (EffectiveTicket);
+CREATE INDEX Transactions1 ON Transactions (ObjectType, ObjectId);
# }}}
@@ -337,22 +339,30 @@ CREATE TABLE Templates (
# }}}
-# {{{ TicketCustomFieldValues
+# {{{ ObjectCustomFieldValues
-CREATE TABLE TicketCustomFieldValues (
+CREATE TABLE ObjectCustomFieldValues (
id INTEGER NOT NULL AUTO_INCREMENT,
- Ticket int NOT NULL ,
CustomField int NOT NULL ,
+ ObjectType varchar(255) NOT NULL, # Final target of the Object
+ ObjectId int NOT NULL , # New -- Replaces Ticket
+ SortOrder integer NOT NULL DEFAULT 0 , # New -- ordering for multiple values
+
Content varchar(255) NULL ,
+ LargeContent LONGTEXT NULL, # New -- to hold 255+ strings
+ ContentType varchar(80) NULL, # New -- only text/* gets searched
+ ContentEncoding varchar(80) NULL , # New -- for binary Content
Creator integer NOT NULL DEFAULT 0 ,
Created DATETIME NULL ,
LastUpdatedBy integer NOT NULL DEFAULT 0 ,
LastUpdated DATETIME NULL ,
+ Disabled int2 NOT NULL DEFAULT 0 , # New -- whether the value was current
PRIMARY KEY (id)
) TYPE=InnoDB;
-CREATE INDEX TicketCustomFieldValues1 ON TicketCustomFieldValues (CustomField,Ticket,Content);
+CREATE INDEX ObjectCustomFieldValues1 ON ObjectCustomFieldValues (Content);
+CREATE INDEX ObjectCustomFieldValues2 ON ObjectCustomFieldValues (CustomField,ObjectType,ObjectId);
# }}}
@@ -361,10 +371,13 @@ CREATE INDEX TicketCustomFieldValues1 ON TicketCustomFieldValues (CustomField,Ti
CREATE TABLE CustomFields (
id INTEGER NOT NULL AUTO_INCREMENT,
Name varchar(200) NULL ,
- Type varchar(200) NULL ,
- Queue integer NOT NULL DEFAULT 0 ,
+ Type varchar(200) NULL , # Changed -- 'Single' and 'Multiple' is moved out
+ MaxValues integer, # New -- was 'Single'(1) and 'Multiple'(0)
+ Pattern varchar(255) NULL , # New -- Must validate against this
+ Repeated int2 NOT NULL DEFAULT 0 , # New -- repeated table entry
Description varchar(255) NULL ,
SortOrder integer NOT NULL DEFAULT 0 ,
+ LookupType varchar(255) NOT NULL,
Creator integer NOT NULL DEFAULT 0 ,
Created DATETIME NULL ,
@@ -374,8 +387,22 @@ CREATE TABLE CustomFields (
PRIMARY KEY (id)
) TYPE=InnoDB;
-CREATE INDEX CustomFields1 on CustomFields (Disabled, Queue);
+# }}}
+
+# {{{ ObjectCustomFields
+
+CREATE TABLE ObjectCustomFields (
+ id INTEGER NOT NULL AUTO_INCREMENT,
+ CustomField int NOT NULL ,
+ ObjectId integer NOT NULL,
+ SortOrder integer NOT NULL DEFAULT 0 ,
+ Creator integer NOT NULL DEFAULT 0 ,
+ Created DATETIME NULL ,
+ LastUpdatedBy integer NOT NULL DEFAULT 0 ,
+ LastUpdated DATETIME NULL ,
+ PRIMARY KEY (id)
+) TYPE=InnoDB;
# }}}
diff --git a/rt/etc/upgrade/3.1.0/schema.Pg b/rt/etc/upgrade/3.1.0/schema.Pg
index 67ea73827..94c3fe70d 100755
--- a/rt/etc/upgrade/3.1.0/schema.Pg
+++ b/rt/etc/upgrade/3.1.0/schema.Pg
@@ -9,7 +9,7 @@ CREATE TABLE Attributes (
Content text,
ContentType varchar(16),
ObjectType varchar(64),
- ObjectId integer, -- foreign key to anything
+ ObjectId integer,
Creator integer NOT NULL DEFAULT 0 ,
Created TIMESTAMP NULL ,
LastUpdatedBy integer NOT NULL DEFAULT 0 ,
diff --git a/rt/etc/upgrade/3.1.0/schema.SQLite b/rt/etc/upgrade/3.1.0/schema.SQLite
index 87a1cc47f..1dd466fa7 100644
--- a/rt/etc/upgrade/3.1.0/schema.SQLite
+++ b/rt/etc/upgrade/3.1.0/schema.SQLite
@@ -13,7 +13,8 @@ CREATE TABLE Attributes (
LastUpdated DATETIME NULL
) ;
-CREATE INDEX Attributes1 on Attributes(Name)
+
+CREATE INDEX Attributes1 on Attributes(Name);
CREATE INDEX Attributes2 on Attributes(ObjectType, ObjectId);
--- }}}
diff --git a/rt/etc/upgrade/3.3.0/acl.Informix b/rt/etc/upgrade/3.3.0/acl.Informix
new file mode 100644
index 000000000..73c16ae03
--- /dev/null
+++ b/rt/etc/upgrade/3.3.0/acl.Informix
@@ -0,0 +1,4 @@
+sub acl {
+ return ();
+}
+1;
diff --git a/rt/etc/upgrade/3.3.0/acl.Oracle b/rt/etc/upgrade/3.3.0/acl.Oracle
new file mode 100644
index 000000000..73c16ae03
--- /dev/null
+++ b/rt/etc/upgrade/3.3.0/acl.Oracle
@@ -0,0 +1,4 @@
+sub acl {
+ return ();
+}
+1;
diff --git a/rt/etc/upgrade/3.3.0/acl.Pg b/rt/etc/upgrade/3.3.0/acl.Pg
new file mode 100644
index 000000000..2069a198e
--- /dev/null
+++ b/rt/etc/upgrade/3.3.0/acl.Pg
@@ -0,0 +1,20 @@
+sub acl {
+ my $dbh = shift;
+
+ my @acls;
+
+ my @tables = qw (
+ objectcustomfieldvalues
+ objectcustomfields_id_s
+ objectcustomfields
+ );
+
+ foreach my $table (@tables) {
+ push @acls,
+ "GRANT SELECT, INSERT, UPDATE, DELETE ON $table to "
+ . $RT::DatabaseUser . ";";
+
+ }
+ return (@acls);
+}
+1;
diff --git a/rt/etc/upgrade/3.3.0/acl.SQLite b/rt/etc/upgrade/3.3.0/acl.SQLite
new file mode 100644
index 000000000..73c16ae03
--- /dev/null
+++ b/rt/etc/upgrade/3.3.0/acl.SQLite
@@ -0,0 +1,4 @@
+sub acl {
+ return ();
+}
+1;
diff --git a/rt/etc/upgrade/3.3.0/acl.mysql b/rt/etc/upgrade/3.3.0/acl.mysql
new file mode 100644
index 000000000..73c16ae03
--- /dev/null
+++ b/rt/etc/upgrade/3.3.0/acl.mysql
@@ -0,0 +1,4 @@
+sub acl {
+ return ();
+}
+1;
diff --git a/rt/etc/upgrade/3.3.0/content b/rt/etc/upgrade/3.3.0/content
new file mode 100644
index 000000000..0afc6045c
--- /dev/null
+++ b/rt/etc/upgrade/3.3.0/content
@@ -0,0 +1 @@
+1;
diff --git a/rt/etc/upgrade/3.3.0/schema.Oracle b/rt/etc/upgrade/3.3.0/schema.Oracle
new file mode 100644
index 000000000..f81feeb79
--- /dev/null
+++ b/rt/etc/upgrade/3.3.0/schema.Oracle
@@ -0,0 +1,65 @@
+alter Table Transactions ADD ObjectType VARCHAR2(64);
+UPDATE Transactions set ObjectType = 'RT::Ticket';
+ALTER TABLE Transactions modify ObjectType NOT NULL;
+ALTER TABLE Transactions drop column EffectiveTicket;
+ALTER TABLE Transactions ADD ReferenceType VARCHAR2(255) NULL;
+ALTER TABLE Transactions ADD OldReference NUMBER(11,0) NULL;
+ALTER TABLE Transactions ADD NewReference NUMBER(11,0) NULL;
+DROP INDEX transactions1;
+ALTER TABLE Transactions rename column Ticket to ObjectId;
+CREATE INDEX Transactions1 ON Transactions (ObjectType, ObjectId);
+
+ALTER TABLE TicketCustomFieldValues rename to ObjectCustomFieldValues;
+ALTER TABLE ObjectCustomFieldValues rename column Ticket to ObjectId;
+ALTER TABLE ObjectCustomFieldValues ADD ObjectType VARCHAR2(255);
+UPDATE ObjectCustomFieldValues set ObjectType = 'RT::Ticket';
+ALTER TABLE ObjectCustomFieldValues MODIFY ObjectType NOT NULL;
+ALTER TABLE ObjectCustomFieldValues ADD Disabled NUMBER(11,0);
+ALTER TABLE ObjectCustomFieldValues MODIFY Disabled default 0;
+UPDATE ObjectCustomFieldValues SET Disabled = 0;
+ALTER TABLE ObjectCustomFieldValues MODIFY Disabled NOT NULL;
+ALTER TABLE ObjectCustomFieldValues ADD LargeContent CLOB NULL;
+ALTER TABLE ObjectCustomFieldValues ADD ContentType VARCHAR2(80) NULL;
+ALTER TABLE ObjectCustomFieldValues ADD ContentEncoding VARCHAR2(80) NULL;
+ALTER TABLE ObjectCustomFieldValues ADD SortOrder NUMBER(11,0) DEFAULT 0 NOT NULL;
+
+
+
+CREATE INDEX ObjectCustomFieldValues1 on ObjectCustomFieldValues (CustomField,ObjectType,ObjectId,Content);
+CREATE INDEX ObjectCustomFieldValues2 on ObjectCustomFieldValues (CustomField,ObjectType,ObjectId);
+
+
+
+CREATE SEQUENCE OBJECTCUSTOMFIELDS_seq;
+CREATE TABLE ObjectCustomFields (
+ id NUMBER(11,0)
+ CONSTRAINT ObjectCustomFields_Key PRIMARY KEY,
+ CustomField NUMBER(11,0) NOT NULL,
+ ObjectId NUMBER(11,0) NOT NULL,
+ SortOrder NUMBER(11,0) DEFAULT 0 NOT NULL,
+ Creator NUMBER(11,0) DEFAULT 0 NOT NULL,
+ Created DATE,
+ LastUpdatedBy NUMBER(11,0) DEFAULT 0 NOT NULL,
+ LastUpdated DATE
+);
+
+
+INSERT into ObjectCustomFields (id, CustomField, ObjectId, SortOrder, Creator, LastUpdatedBy) SELECT objectcustomfields_seq.nextval, id, Queue, SortOrder, Creator, LastUpdatedBy from CustomFields;
+
+ALTER TABLE CustomFields ADD LookupType VARCHAR2(255);
+ALTER TABLE CustomFields ADD Repeated NUMBER(11,0);
+ALTER TABLE CustomFields ADD Pattern VARCHAR2(255) NULL;
+ALTER TABLE CustomFields ADD MaxValues NUMBER(11,0);
+
+UPDATE CustomFields SET MaxValues = 0 WHERE Type LIKE '%Multiple';
+UPDATE CustomFields SET MaxValues = 1 WHERE Type LIKE '%Single';
+UPDATE CustomFields SET Type = 'Select' WHERE Type LIKE 'Select%';
+UPDATE CustomFields SET Type = 'Freeform' WHERE Type LIKE 'Freeform%';
+UPDATE CustomFields Set LookupType = 'RT::Queue-RT::Ticket';
+ALTER TABLE CustomFields MODIFY LookupType NOT NULL;
+UPDATE CustomFields Set Repeated = 0;
+ALTER TABLE CustomFields MODIFY Repeated DEFAULT 0;
+ALTER TABLE CustomFields MODIFY Repeated NOT NULL;
+ALTER TABLE CustomFields drop column Queue;
+
+
diff --git a/rt/etc/upgrade/3.3.0/schema.Pg b/rt/etc/upgrade/3.3.0/schema.Pg
new file mode 100644
index 000000000..427eae798
--- /dev/null
+++ b/rt/etc/upgrade/3.3.0/schema.Pg
@@ -0,0 +1,74 @@
+alter Table Transactions ADD Column ObjectType varchar(64);
+update Transactions set ObjectType = 'RT::Ticket';
+ALTER TABLE Transactions ALTER COLUMN ObjectType SET NOT NULL;
+alter table Transactions drop column EffectiveTicket;
+alter table Transactions add column ReferenceType varchar(255) NULL;
+alter table Transactions add column OldReference integer NULL;
+alter table Transactions add column NewReference integer NULL;
+drop index transactions1;
+alter table Transactions rename column Ticket to ObjectId;
+
+
+CREATE INDEX Transactions1 ON Transactions (ObjectType, ObjectId);
+
+alter table TicketCustomFieldValues rename to ObjectCustomFieldValues;
+
+alter table ObjectCustomFieldValues rename column Ticket to ObjectId;
+
+alter table objectcustomfieldvalues add column ObjectType varchar(255);
+
+update objectcustomfieldvalues set ObjectType = 'RT::Ticket';
+
+ALTER TABLE objectcustomfieldvalues ALTER COLUMN ObjectType SET NOT NULL;
+
+alter table objectcustomfieldvalues add column Current int;
+
+alter table objectcustomfieldvalues alter column Current SET default 1;
+
+UPDATE objectcustomfieldvalues SET Current = 1;
+
+alter table objectcustomfieldvalues add column LargeContent TEXT NULL;
+
+alter table objectcustomfieldvalues add column ContentType varchar(80) NULL;
+
+alter table objectcustomfieldvalues add column ContentEncoding varchar(80) NULL;
+
+create index ObjectCustomFieldValues1 on objectcustomfieldvalues (CustomField,ObjectType,ObjectId,Content);
+
+create index ObjectCustomFieldValues2 on objectcustomfieldvalues (CustomField,ObjectType,ObjectId);
+
+
+CREATE SEQUENCE objectcustomfields_id_s;
+
+CREATE TABLE ObjectCustomFields (
+ id INTEGER DEFAULT nextval('objectcustomfields_id_s'),
+ CustomField integer NOT NULL,
+ ObjectId integer NOT NULL,
+ SortOrder integer NOT NULL DEFAULT 0 ,
+
+ Creator integer NOT NULL DEFAULT 0 ,
+ Created TIMESTAMP NULL ,
+ LastUpdatedBy integer NOT NULL DEFAULT 0 ,
+ LastUpdated TIMESTAMP NULL ,
+ PRIMARY KEY (id)
+
+);
+
+
+INSERT into ObjectCustomFields (CustomField, ObjectId, SortOrder, Creator, LastUpdatedBy) SELECT id, Queue, SortOrder, Creator, LastUpdatedBy from CustomFields;
+
+alter table CustomFields add column LookupType varchar(255);
+alter table CustomFields add column Repeated int2;
+alter table CustomFields add column Pattern varchar(255) NULL;
+alter table CustomFields add column MaxValues integer;
+
+UPDATE CustomFields SET MaxValues = 0 WHERE Type LIKE '%Multiple';
+UPDATE CustomFields SET MaxValues = 1 WHERE Type LIKE '%Single';
+UPDATE CustomFields SET Type = 'Select' WHERE Type LIKE 'Select%';
+UPDATE CustomFields SET Type = 'Freeform' WHERE Type LIKE 'Freeform%';
+UPDATE CustomFields Set LookupType = 'RT::Queue-RT::Ticket';
+ALTER TABLE CustomFields ALTER COLUMN LookupType SET NOT NULL;
+UPDATE CustomFields Set Repeated = 0;
+ALTER TABLE CustomFields ALTER COLUMN Repeated SET DEFAULT 0;
+ALTER TABLE CustomFields ALTER COLUMN Repeated SET NOT NULL;
+alter table CustomFields drop column Queue;
diff --git a/rt/etc/upgrade/3.3.0/schema.mysql b/rt/etc/upgrade/3.3.0/schema.mysql
new file mode 100644
index 000000000..0e33a2819
--- /dev/null
+++ b/rt/etc/upgrade/3.3.0/schema.mysql
@@ -0,0 +1,65 @@
+alter Table Transactions ADD Column (ObjectType varchar(64) not null);
+update Transactions set ObjectType = 'RT::Ticket';
+alter table Transactions drop column EffectiveTicket;
+alter table Transactions add column ReferenceType varchar(255) NULL;
+alter table Transactions add column OldReference integer NULL;
+alter table Transactions add column NewReference integer NULL;
+alter table Transactions drop index transactions1;
+alter table Transactions change Ticket ObjectId integer NOT NULL DEFAULT 0 ;
+
+CREATE INDEX Transactions1 ON Transactions (ObjectType, ObjectId);
+
+alter table TicketCustomFieldValues rename ObjectCustomFieldValues;
+
+alter table ObjectCustomFieldValues change Ticket ObjectId integer NOT NULL DEFAULT 0 ;
+
+alter table ObjectCustomFieldValues add column ObjectType varchar(255) not null;
+
+update ObjectCustomFieldValues set ObjectType = 'RT::Ticket';
+
+alter table ObjectCustomFieldValues add column Current bool default 1;
+
+alter table ObjectCustomFieldValues add column LargeContent LONGTEXT NULL;
+
+alter table ObjectCustomFieldValues add column ContentType varchar(80) NULL;
+
+alter table ObjectCustomFieldValues add column ContentEncoding varchar(80) NULL;
+
+# These could fail if there's no such index and there's no "drop index if exists" syntax
+#alter table ObjectCustomFieldValues drop index ticketcustomfieldvalues1;
+#alter table ObjectCustomFieldValues drop index ticketcustomfieldvalues2;
+
+alter table ObjectCustomFieldValues add index ObjectCustomFieldValues1 (Content);
+
+alter table ObjectCustomFieldValues add index ObjectCustomFieldValues2 (CustomField,ObjectType,ObjectId);
+
+
+CREATE TABLE ObjectCustomFields (
+ id INTEGER NOT NULL AUTO_INCREMENT,
+ CustomField int NOT NULL ,
+ ObjectId integer NOT NULL,
+ SortOrder integer NOT NULL DEFAULT 0 ,
+
+ Creator integer NOT NULL DEFAULT 0 ,
+ Created DATETIME NULL ,
+ LastUpdatedBy integer NOT NULL DEFAULT 0 ,
+ LastUpdated DATETIME NULL ,
+ PRIMARY KEY (id)
+) TYPE=InnoDB;
+
+
+INSERT into ObjectCustomFields (id, CustomField, ObjectId, SortOrder, Creator, LastUpdatedBy) SELECT null, id, Queue, SortOrder, Creator, LastUpdatedBy from CustomFields;
+
+alter table CustomFields add column LookupType varchar(255) NOT NULL;
+alter table CustomFields add column Repeated int2 NOT NULL DEFAULT 0 ;
+alter table CustomFields add column Pattern varchar(255) NULL;
+alter table CustomFields add column MaxValues integer;
+# See above
+# alter table CustomFields drop index CustomFields1;
+
+UPDATE CustomFields SET MaxValues = 0 WHERE Type LIKE '%Multiple';
+UPDATE CustomFields SET MaxValues = 1 WHERE Type LIKE '%Single';
+UPDATE CustomFields SET Type = 'Select' WHERE Type LIKE 'Select%';
+UPDATE CustomFields SET Type = 'Freeform' WHERE Type LIKE 'Freeform%';
+UPDATE CustomFields Set LookupType = 'RT::Queue-RT::Ticket';
+alter table CustomFields drop column Queue;
diff --git a/rt/etc/upgrade/3.3.11/acl.Oracle b/rt/etc/upgrade/3.3.11/acl.Oracle
new file mode 100644
index 000000000..73c16ae03
--- /dev/null
+++ b/rt/etc/upgrade/3.3.11/acl.Oracle
@@ -0,0 +1,4 @@
+sub acl {
+ return ();
+}
+1;
diff --git a/rt/etc/upgrade/3.3.11/acl.Pg b/rt/etc/upgrade/3.3.11/acl.Pg
new file mode 100644
index 000000000..73c16ae03
--- /dev/null
+++ b/rt/etc/upgrade/3.3.11/acl.Pg
@@ -0,0 +1,4 @@
+sub acl {
+ return ();
+}
+1;
diff --git a/rt/etc/upgrade/3.3.11/acl.SQLite b/rt/etc/upgrade/3.3.11/acl.SQLite
new file mode 100644
index 000000000..73c16ae03
--- /dev/null
+++ b/rt/etc/upgrade/3.3.11/acl.SQLite
@@ -0,0 +1,4 @@
+sub acl {
+ return ();
+}
+1;
diff --git a/rt/etc/upgrade/3.3.11/acl.mysql b/rt/etc/upgrade/3.3.11/acl.mysql
new file mode 100644
index 000000000..73c16ae03
--- /dev/null
+++ b/rt/etc/upgrade/3.3.11/acl.mysql
@@ -0,0 +1,4 @@
+sub acl {
+ return ();
+}
+1;
diff --git a/rt/etc/upgrade/3.3.11/content b/rt/etc/upgrade/3.3.11/content
new file mode 100644
index 000000000..0afc6045c
--- /dev/null
+++ b/rt/etc/upgrade/3.3.11/content
@@ -0,0 +1 @@
+1;
diff --git a/rt/etc/upgrade/3.3.11/schema.Oracle b/rt/etc/upgrade/3.3.11/schema.Oracle
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/rt/etc/upgrade/3.3.11/schema.Oracle
diff --git a/rt/etc/upgrade/3.3.11/schema.Pg b/rt/etc/upgrade/3.3.11/schema.Pg
new file mode 100644
index 000000000..6ab5d6581
--- /dev/null
+++ b/rt/etc/upgrade/3.3.11/schema.Pg
@@ -0,0 +1,11 @@
+ALTER TABLE ObjectCustomFieldValues ADD COLUMN SortOrder INTEGER;
+UPDATE ObjectCustomFieldValues SET SortOrder = 0;
+ALTER TABLE ObjectCustomFieldValues ALTER COLUMN SortOrder SET DEFAULT 0;
+ALTER TABLE ObjectCustomFieldValues ALTER COLUMN SortOrder SET NOT NULL;
+ALTER TABLE ObjectCustomFieldValues ADD COLUMN Disabled INTEGER;
+UPDATE ObjectCustomFieldValues SET Disabled = 1 WHERE Current = 0;
+UPDATE ObjectCustomFieldValues SET Disabled = 0 WHERE Current != 0;
+ALTER TABLE ObjectCustomFieldValues ALTER COLUMN Disabled SET DEFAULT 0;
+ALTER TABLE ObjectCustomFieldValues ALTER COLUMN Disabled SET NOT NULL;
+
+ALTER TABLE ObjectCustomFieldValues DROP COLUMN Current;
diff --git a/rt/etc/upgrade/3.3.11/schema.SQLite b/rt/etc/upgrade/3.3.11/schema.SQLite
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/rt/etc/upgrade/3.3.11/schema.SQLite
diff --git a/rt/etc/upgrade/3.3.11/schema.mysql b/rt/etc/upgrade/3.3.11/schema.mysql
new file mode 100644
index 000000000..cc35d40f2
--- /dev/null
+++ b/rt/etc/upgrade/3.3.11/schema.mysql
@@ -0,0 +1,5 @@
+ALTER TABLE ObjectCustomFieldValues ADD COLUMN SortOrder INTEGER NOT NULL DEFAULT 0;
+ALTER TABLE ObjectCustomFieldValues ADD COLUMN Disabled int2 NOT NULL DEFAULT 0;
+
+UPDATE ObjectCustomFieldValues SET Disabled = 1 WHERE Current = 0;
+ALTER TABLE ObjectCustomFieldValues DROP COLUMN Current;