diff options
author | ivan <ivan> | 2005-10-15 09:11:20 +0000 |
---|---|---|
committer | ivan <ivan> | 2005-10-15 09:11:20 +0000 |
commit | 673b9a458d9138523026963df6fa3b4683e09bae (patch) | |
tree | 42acc524ff5fd53e4fdb2f5b6dac4a42ce8057f6 /rt/etc | |
parent | 591613cf1c861505335646fff3ffb4a705e011bf (diff) | |
parent | d4d0590bef31071e8809ec046717444b95b3f30a (diff) |
This commit was generated by cvs2svn to compensate for changes in r4407,
which included commits to RCS files with non-trunk default branches.
Diffstat (limited to 'rt/etc')
24 files changed, 439 insertions, 60 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/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.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/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; |