From 945721f48f74d5cfffef7c7cf3a3d6bc2521f5dd Mon Sep 17 00:00:00 2001 From: ivan Date: Tue, 15 Jul 2003 13:16:32 +0000 Subject: import of rt 3.0.4 --- rt/etc/upgrade/2.1.71 | 211 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 211 insertions(+) create mode 100644 rt/etc/upgrade/2.1.71 (limited to 'rt/etc/upgrade') diff --git a/rt/etc/upgrade/2.1.71 b/rt/etc/upgrade/2.1.71 new file mode 100644 index 000000000..cb89a3ac3 --- /dev/null +++ b/rt/etc/upgrade/2.1.71 @@ -0,0 +1,211 @@ +@Queues = ( { + Name => '___Approvals', + Description => 'A system-internal queue for the approvals system', + Disabled => 2, + } +); + + + + + +# {{{ Templates +@Templates = ( + { + Queue => '___Approvals', + Name => "New Pending Approval", # loc + Description => "Notify Owners and AdminCcs of new items pending their approval", # loc + Content => 'Subject: New Pending Approval: {$Ticket->Subject} + +Greetings, + +There is a new item pending your approval: "{$Ticket->Subject()}", +a summary of which appears below. + +Please visit {$RT::WebURL}Approvals/Display.html?id={$Ticket->id} +to approve or reject this ticket, or {$RT::WebURL}Approvals/ to +batch-process all your pending approvals. + +------------------------------------------------------------------------- +{$Transaction->Content()} +' + }, +); + +# }}} + +1; + +@ScripActions = ( + { Name => 'Open Tickets', + Description => 'Open tickets on correspondence', + ExecModule => 'AutoOpen' }, + +); + + @Scrips = ( + { ScripCondition => 'On Correspond', + ScripAction => 'Open Tickets', + Template => 'Blank', + Queue => '0' + }, + { ScripCondition => 'On Create', + ScripAction => 'AutoReply To Requestors', + Template => 'AutoReply' }, + { ScripCondition => 'On Create', + ScripAction => 'Notify AdminCcs', + Template => 'Transaction' }, + { ScripCondition => 'On Correspond', + ScripAction => 'Notify AdminCcs', + Template => 'Admin Correspondence' }, + { ScripCondition => 'On Correspond', + ScripAction => 'Notify Requestors And Ccs', + Template => 'Correspondence' }, + { ScripCondition => 'On Correspond', + ScripAction => 'Notify Other Recipients', + Template => 'Correspondence' }, + { ScripCondition => 'On Comment', + ScripAction => 'Notify AdminCcs As Comment', + Template => 'Admin Comment' }, + { ScripCondition => 'On Comment', + ScripAction => 'Notify Other Recipients As Comment', + Template => 'Correspondence' }, + { ScripCondition => 'On Resolve', + ScripAction => 'Notify Requestors', + Template => 'Resolved' }, + + + { + Description => "When an approval ticket is created, notify the Owner and AdminCc of the item awaiting their approval", # loc + Queue => '___Approvals', + ScripCondition => 'On Create', + ScripAction => 'Notify AdminCcs', + Template => 'New Pending Approval' + }, + { + Description => "If an approval is rejected, reject the original and delete pending approvals", # loc + Queue => '___Approvals', + ScripCondition => 'On Status Change', + ScripAction => 'User Defined', + CustomCommitCode => q[ +# ------------------------------------------------------------------- # +return(1) unless ( lc($self->TransactionObj->NewValue) eq "rejected" or + lc($self->TransactionObj->NewValue) eq "deleted" ); + +my $links = $self->TicketObj->DependedOnBy; +foreach my $link (@{ $links->ItemsArrayRef }) { + my $obj = $link->BaseObj; + if ($obj->QueueObj->IsActiveStatus($obj->Status)) { + if ($obj->Type eq 'ticket') { + $obj->Correspond( + Content => $self->loc("Your request was rejected."), + ); + $obj->SetStatus( + Status => 'rejected', + Force => 1, + ); + } + else { + $obj->SetStatus( + Status => 'deleted', + Force => 1, + ); + } + } +} + +$links = $self->TicketObj->DependsOn; +foreach my $link (@{ $links->ItemsArrayRef }) { + my $obj = $link->TargetObj; + if ($obj->QueueObj->IsActiveStatus($obj->Status)) { + $obj->SetStatus( + Status => 'deleted', + Force => 1, + ); + } +} + +return 1; +# ------------------------------------------------------------------- # + ], + CustomPrepareCode => '1', + Template => 'Admin Comment', + }, + { + Description => "When a ticket has been approved by any approver, add correspondence to the original ticket", # loc + Queue => '___Approvals', + ScripCondition => 'On Resolve', + ScripAction => 'User Defined', + CustomPrepareCode => 'return(1);', + CustomCommitCode => q[ +# ------------------------------------------------------------------- # +return(1) unless ($self->TicketObj->Type eq 'approval'); + +foreach my $obj ($self->TicketObj->AllDependedOnBy( Type => 'ticket' )) { + $obj->Correspond( + Content => $self->loc( "Your request has been approved by [_1]. Other approvals may still be pending.", # loc + $self->TransactionObj->CreatorObj->Name, + ) . "\n" . $self->loc( "Approver's notes: [_1]", # loc + $self->TicketObj->Transactions->Last->Content, + ), + _reopen => 0, + ); +} + +return 1; +# ------------------------------------------------------------------- # + ], + Template => 'Admin Comment' + }, + { + Description => "When a ticket has been approved by all approvers, add correspondence to the original ticket", # loc + Queue => '___Approvals', + ScripCondition => 'On Resolve', + ScripAction => 'User Defined', + CustomPrepareCode => 'return(1);', + CustomCommitCode => q[ +# ------------------------------------------------------------------- # +# Find all the tickets that depend on this (that this is approving) + +my $Ticket = $self->TicketObj; +my @TOP = $Ticket->AllDependedOnBy( Type => 'ticket' ); +my $links = $Ticket->DependedOnBy; + +while (my $link = $links->Next) { + my $obj = $link->BaseObj; + next if ($obj->HasUnresolvedDependencies( Type => 'approval' )); + + if ($obj->Type eq 'ticket') { + $obj->Correspond( + Content => $self->loc("Your request has been approved."), + _reopen => 0, + ); + } + elsif ($obj->Type eq 'code') { + my $code = $obj->Transactions->First->Content; + my $rv; + + foreach my $TOP (@TOP) { + local $@; + $rv++ if eval $code; + $RT::Logger->error("Cannot eval code: $@") if $@; + } + + if ($rv or !@TOP) { + $obj->SetStatus( Status => 'resolved', Force => 1,); + } + else { + $obj->SetStatus( Status => 'rejected', Force => 1,); + } + } +} + +return 1; +# ------------------------------------------------------------------- # + ], + Template => 'Admin Comment', + }, +); + +# }}} + -- cgit v1.2.1 From d39d52aac8f38ea9115628039f0df5aa3ac826de Mon Sep 17 00:00:00 2001 From: ivan Date: Fri, 3 Dec 2004 20:40:48 +0000 Subject: import rt 3.2.2 --- rt/etc/upgrade/3.1.0/acl.Informix | 4 ++++ rt/etc/upgrade/3.1.0/acl.Oracle | 4 ++++ rt/etc/upgrade/3.1.0/acl.Pg | 19 +++++++++++++++++++ rt/etc/upgrade/3.1.0/acl.SQLite | 4 ++++ rt/etc/upgrade/3.1.0/acl.mysql | 4 ++++ rt/etc/upgrade/3.1.0/content | 2 ++ rt/etc/upgrade/3.1.0/schema.Informix | 17 +++++++++++++++++ rt/etc/upgrade/3.1.0/schema.Oracle | 17 +++++++++++++++++ rt/etc/upgrade/3.1.0/schema.Pg | 25 +++++++++++++++++++++++++ rt/etc/upgrade/3.1.0/schema.SQLite | 20 ++++++++++++++++++++ rt/etc/upgrade/3.1.0/schema.mysql | 21 +++++++++++++++++++++ rt/etc/upgrade/3.1.15/content | 7 +++++++ rt/etc/upgrade/3.1.17/content | 22 ++++++++++++++++++++++ 13 files changed, 166 insertions(+) create mode 100644 rt/etc/upgrade/3.1.0/acl.Informix create mode 100755 rt/etc/upgrade/3.1.0/acl.Oracle create mode 100755 rt/etc/upgrade/3.1.0/acl.Pg create mode 100755 rt/etc/upgrade/3.1.0/acl.SQLite create mode 100755 rt/etc/upgrade/3.1.0/acl.mysql create mode 100644 rt/etc/upgrade/3.1.0/content create mode 100644 rt/etc/upgrade/3.1.0/schema.Informix create mode 100644 rt/etc/upgrade/3.1.0/schema.Oracle create mode 100755 rt/etc/upgrade/3.1.0/schema.Pg create mode 100644 rt/etc/upgrade/3.1.0/schema.SQLite create mode 100755 rt/etc/upgrade/3.1.0/schema.mysql create mode 100644 rt/etc/upgrade/3.1.15/content create mode 100644 rt/etc/upgrade/3.1.17/content (limited to 'rt/etc/upgrade') diff --git a/rt/etc/upgrade/3.1.0/acl.Informix b/rt/etc/upgrade/3.1.0/acl.Informix new file mode 100644 index 000000000..73c16ae03 --- /dev/null +++ b/rt/etc/upgrade/3.1.0/acl.Informix @@ -0,0 +1,4 @@ +sub acl { + return (); +} +1; diff --git a/rt/etc/upgrade/3.1.0/acl.Oracle b/rt/etc/upgrade/3.1.0/acl.Oracle new file mode 100755 index 000000000..73c16ae03 --- /dev/null +++ b/rt/etc/upgrade/3.1.0/acl.Oracle @@ -0,0 +1,4 @@ +sub acl { + return (); +} +1; diff --git a/rt/etc/upgrade/3.1.0/acl.Pg b/rt/etc/upgrade/3.1.0/acl.Pg new file mode 100755 index 000000000..809e99ab3 --- /dev/null +++ b/rt/etc/upgrade/3.1.0/acl.Pg @@ -0,0 +1,19 @@ +sub acl { + my $dbh = shift; + + my @acls; + + my @tables = qw ( + attributes_id_seq + attributes + ); + + 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.1.0/acl.SQLite b/rt/etc/upgrade/3.1.0/acl.SQLite new file mode 100755 index 000000000..73c16ae03 --- /dev/null +++ b/rt/etc/upgrade/3.1.0/acl.SQLite @@ -0,0 +1,4 @@ +sub acl { + return (); +} +1; diff --git a/rt/etc/upgrade/3.1.0/acl.mysql b/rt/etc/upgrade/3.1.0/acl.mysql new file mode 100755 index 000000000..73c16ae03 --- /dev/null +++ b/rt/etc/upgrade/3.1.0/acl.mysql @@ -0,0 +1,4 @@ +sub acl { + return (); +} +1; diff --git a/rt/etc/upgrade/3.1.0/content b/rt/etc/upgrade/3.1.0/content new file mode 100644 index 000000000..3117dafc5 --- /dev/null +++ b/rt/etc/upgrade/3.1.0/content @@ -0,0 +1,2 @@ +# nothing to do +1; diff --git a/rt/etc/upgrade/3.1.0/schema.Informix b/rt/etc/upgrade/3.1.0/schema.Informix new file mode 100644 index 000000000..722eb70b3 --- /dev/null +++ b/rt/etc/upgrade/3.1.0/schema.Informix @@ -0,0 +1,17 @@ +CREATE TABLE Attributes ( + id SERIAL, + Name VARCHAR(255) DEFAULT '' NOT NULL, + Description VARCHAR(255) DEFAULT NULL, + Content BYTE, + ContentType VARCHAR(16), + ObjectType VARCHAR(25) NOT NULL, + ObjectId INTEGER DEFAULT 0 NOT NULL, + Creator INTEGER DEFAULT 0 NOT NULL, + Created DATETIME YEAR TO SECOND, + LastUpdatedBy INTEGER DEFAULT 0 NOT NULL, + LastUpdated DATETIME YEAR TO SECOND, + PRIMARY KEY (id) +); + +CREATE INDEX Attributes1 on Attributes(Name); +CREATE INDEX Attributes2 on Attributes(ObjectType, ObjectId); diff --git a/rt/etc/upgrade/3.1.0/schema.Oracle b/rt/etc/upgrade/3.1.0/schema.Oracle new file mode 100644 index 000000000..a8aae18b5 --- /dev/null +++ b/rt/etc/upgrade/3.1.0/schema.Oracle @@ -0,0 +1,17 @@ +CREATE SEQUENCE ATTRIBUTES_seq; +CREATE TABLE Attributes ( + id NUMBER(11,0) PRIMARY KEY, + Name VARCHAR2(255) NOT NULL, + Description VARCHAR2(255), + Content CLOB, + ContentType VARCHAR(16), + ObjectType VARCHAR2(25) NOT NULL, + ObjectId 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 INDEX Attributes1 on Attributes(Name); +CREATE INDEX Attributes2 on Attributes(ObjectType, ObjectId); diff --git a/rt/etc/upgrade/3.1.0/schema.Pg b/rt/etc/upgrade/3.1.0/schema.Pg new file mode 100755 index 000000000..67ea73827 --- /dev/null +++ b/rt/etc/upgrade/3.1.0/schema.Pg @@ -0,0 +1,25 @@ +-- {{{ Attributes + +CREATE SEQUENCE attributes_id_seq; + +CREATE TABLE Attributes ( + id INTEGER DEFAULT nextval('attributes_id_seq'), + Name varchar(255) NOT NULL , + Description varchar(255) NULL , + Content text, + ContentType varchar(16), + ObjectType varchar(64), + ObjectId integer, -- foreign key to anything + Creator integer NOT NULL DEFAULT 0 , + Created TIMESTAMP NULL , + LastUpdatedBy integer NOT NULL DEFAULT 0 , + LastUpdated TIMESTAMP NULL , + PRIMARY KEY (id) + +); + +CREATE INDEX Attributes1 on Attributes(Name); +CREATE INDEX Attributes2 on Attributes(ObjectType, ObjectId); + +-- }}} + diff --git a/rt/etc/upgrade/3.1.0/schema.SQLite b/rt/etc/upgrade/3.1.0/schema.SQLite new file mode 100644 index 000000000..87a1cc47f --- /dev/null +++ b/rt/etc/upgrade/3.1.0/schema.SQLite @@ -0,0 +1,20 @@ +--- {{{ Attributes +CREATE TABLE Attributes ( + id INTEGER PRIMARY KEY , + Name varchar(255) NOT NULL , + Description varchar(255) NULL , + Content LONGTEXT NULL , + ContentType varchar(16), + ObjectType varchar(25) NOT NULL , + ObjectId INTEGER default 0, + Creator integer NULL , + Created DATETIME NULL , + LastUpdatedBy integer NULL , + LastUpdated DATETIME NULL + +) ; +CREATE INDEX Attributes1 on Attributes(Name) +CREATE INDEX Attributes2 on Attributes(ObjectType, ObjectId); + +--- }}} + diff --git a/rt/etc/upgrade/3.1.0/schema.mysql b/rt/etc/upgrade/3.1.0/schema.mysql new file mode 100755 index 000000000..c4a345d3e --- /dev/null +++ b/rt/etc/upgrade/3.1.0/schema.mysql @@ -0,0 +1,21 @@ +# {{{ Attributes + +CREATE TABLE Attributes ( + id INTEGER NOT NULL AUTO_INCREMENT, + Name varchar(255) NULL , + Description varchar(255) NULL , + Content text, + ContentType varchar(16), + ObjectType varchar(64), + ObjectId integer, # foreign key to anything + Creator integer NOT NULL DEFAULT 0 , + Created DATETIME NULL , + LastUpdatedBy integer NOT NULL DEFAULT 0 , + LastUpdated DATETIME NULL , + PRIMARY KEY (id) +) TYPE=InnoDB; + +CREATE INDEX Attributes1 on Attributes(Name); +CREATE INDEX Attributes2 on Attributes(ObjectType, ObjectId); + +# }}} diff --git a/rt/etc/upgrade/3.1.15/content b/rt/etc/upgrade/3.1.15/content new file mode 100644 index 000000000..d23125a0b --- /dev/null +++ b/rt/etc/upgrade/3.1.15/content @@ -0,0 +1,7 @@ +@Scrips = ( + { ScripCondition => 'On Owner Change', + ScripAction => 'Notify Owner', + Template => 'Transaction' }, +); + +1; diff --git a/rt/etc/upgrade/3.1.17/content b/rt/etc/upgrade/3.1.17/content new file mode 100644 index 000000000..1d648d82f --- /dev/null +++ b/rt/etc/upgrade/3.1.17/content @@ -0,0 +1,22 @@ +@ScripActions = ( + { Name => 'Notify Ccs as Comment', # loc + Description => 'Sends mail to the Ccs as a comment', # loc + ExecModule => 'NotifyAsComment', + Argument => 'Cc' }, + { Name => 'Notify Ccs', # loc + Description => 'Sends mail to the Ccs', # loc + ExecModule => 'Notify', + Argument => 'Cc' }, +); + + +@ScripConditions = ( + { + Name => 'On Priority Change', # loc + Description => 'Whenever a ticket\'s priority changes', # loc + ApplicableTransTypes => 'Set', + ExecModule => 'PriorityChange', + }, +); + +1; -- cgit v1.2.1 From e81cd66ea62231e89fbd30a95a0e5bdde2292eeb Mon Sep 17 00:00:00 2001 From: ivan Date: Fri, 3 Dec 2004 20:51:54 +0000 Subject: landing rt 3.2.2 --- rt/etc/upgrade/2.1.71 | 211 -------------------------------------------------- 1 file changed, 211 deletions(-) delete mode 100644 rt/etc/upgrade/2.1.71 (limited to 'rt/etc/upgrade') diff --git a/rt/etc/upgrade/2.1.71 b/rt/etc/upgrade/2.1.71 deleted file mode 100644 index cb89a3ac3..000000000 --- a/rt/etc/upgrade/2.1.71 +++ /dev/null @@ -1,211 +0,0 @@ -@Queues = ( { - Name => '___Approvals', - Description => 'A system-internal queue for the approvals system', - Disabled => 2, - } -); - - - - - -# {{{ Templates -@Templates = ( - { - Queue => '___Approvals', - Name => "New Pending Approval", # loc - Description => "Notify Owners and AdminCcs of new items pending their approval", # loc - Content => 'Subject: New Pending Approval: {$Ticket->Subject} - -Greetings, - -There is a new item pending your approval: "{$Ticket->Subject()}", -a summary of which appears below. - -Please visit {$RT::WebURL}Approvals/Display.html?id={$Ticket->id} -to approve or reject this ticket, or {$RT::WebURL}Approvals/ to -batch-process all your pending approvals. - -------------------------------------------------------------------------- -{$Transaction->Content()} -' - }, -); - -# }}} - -1; - -@ScripActions = ( - { Name => 'Open Tickets', - Description => 'Open tickets on correspondence', - ExecModule => 'AutoOpen' }, - -); - - @Scrips = ( - { ScripCondition => 'On Correspond', - ScripAction => 'Open Tickets', - Template => 'Blank', - Queue => '0' - }, - { ScripCondition => 'On Create', - ScripAction => 'AutoReply To Requestors', - Template => 'AutoReply' }, - { ScripCondition => 'On Create', - ScripAction => 'Notify AdminCcs', - Template => 'Transaction' }, - { ScripCondition => 'On Correspond', - ScripAction => 'Notify AdminCcs', - Template => 'Admin Correspondence' }, - { ScripCondition => 'On Correspond', - ScripAction => 'Notify Requestors And Ccs', - Template => 'Correspondence' }, - { ScripCondition => 'On Correspond', - ScripAction => 'Notify Other Recipients', - Template => 'Correspondence' }, - { ScripCondition => 'On Comment', - ScripAction => 'Notify AdminCcs As Comment', - Template => 'Admin Comment' }, - { ScripCondition => 'On Comment', - ScripAction => 'Notify Other Recipients As Comment', - Template => 'Correspondence' }, - { ScripCondition => 'On Resolve', - ScripAction => 'Notify Requestors', - Template => 'Resolved' }, - - - { - Description => "When an approval ticket is created, notify the Owner and AdminCc of the item awaiting their approval", # loc - Queue => '___Approvals', - ScripCondition => 'On Create', - ScripAction => 'Notify AdminCcs', - Template => 'New Pending Approval' - }, - { - Description => "If an approval is rejected, reject the original and delete pending approvals", # loc - Queue => '___Approvals', - ScripCondition => 'On Status Change', - ScripAction => 'User Defined', - CustomCommitCode => q[ -# ------------------------------------------------------------------- # -return(1) unless ( lc($self->TransactionObj->NewValue) eq "rejected" or - lc($self->TransactionObj->NewValue) eq "deleted" ); - -my $links = $self->TicketObj->DependedOnBy; -foreach my $link (@{ $links->ItemsArrayRef }) { - my $obj = $link->BaseObj; - if ($obj->QueueObj->IsActiveStatus($obj->Status)) { - if ($obj->Type eq 'ticket') { - $obj->Correspond( - Content => $self->loc("Your request was rejected."), - ); - $obj->SetStatus( - Status => 'rejected', - Force => 1, - ); - } - else { - $obj->SetStatus( - Status => 'deleted', - Force => 1, - ); - } - } -} - -$links = $self->TicketObj->DependsOn; -foreach my $link (@{ $links->ItemsArrayRef }) { - my $obj = $link->TargetObj; - if ($obj->QueueObj->IsActiveStatus($obj->Status)) { - $obj->SetStatus( - Status => 'deleted', - Force => 1, - ); - } -} - -return 1; -# ------------------------------------------------------------------- # - ], - CustomPrepareCode => '1', - Template => 'Admin Comment', - }, - { - Description => "When a ticket has been approved by any approver, add correspondence to the original ticket", # loc - Queue => '___Approvals', - ScripCondition => 'On Resolve', - ScripAction => 'User Defined', - CustomPrepareCode => 'return(1);', - CustomCommitCode => q[ -# ------------------------------------------------------------------- # -return(1) unless ($self->TicketObj->Type eq 'approval'); - -foreach my $obj ($self->TicketObj->AllDependedOnBy( Type => 'ticket' )) { - $obj->Correspond( - Content => $self->loc( "Your request has been approved by [_1]. Other approvals may still be pending.", # loc - $self->TransactionObj->CreatorObj->Name, - ) . "\n" . $self->loc( "Approver's notes: [_1]", # loc - $self->TicketObj->Transactions->Last->Content, - ), - _reopen => 0, - ); -} - -return 1; -# ------------------------------------------------------------------- # - ], - Template => 'Admin Comment' - }, - { - Description => "When a ticket has been approved by all approvers, add correspondence to the original ticket", # loc - Queue => '___Approvals', - ScripCondition => 'On Resolve', - ScripAction => 'User Defined', - CustomPrepareCode => 'return(1);', - CustomCommitCode => q[ -# ------------------------------------------------------------------- # -# Find all the tickets that depend on this (that this is approving) - -my $Ticket = $self->TicketObj; -my @TOP = $Ticket->AllDependedOnBy( Type => 'ticket' ); -my $links = $Ticket->DependedOnBy; - -while (my $link = $links->Next) { - my $obj = $link->BaseObj; - next if ($obj->HasUnresolvedDependencies( Type => 'approval' )); - - if ($obj->Type eq 'ticket') { - $obj->Correspond( - Content => $self->loc("Your request has been approved."), - _reopen => 0, - ); - } - elsif ($obj->Type eq 'code') { - my $code = $obj->Transactions->First->Content; - my $rv; - - foreach my $TOP (@TOP) { - local $@; - $rv++ if eval $code; - $RT::Logger->error("Cannot eval code: $@") if $@; - } - - if ($rv or !@TOP) { - $obj->SetStatus( Status => 'resolved', Force => 1,); - } - else { - $obj->SetStatus( Status => 'rejected', Force => 1,); - } - } -} - -return 1; -# ------------------------------------------------------------------- # - ], - Template => 'Admin Comment', - }, -); - -# }}} - -- cgit v1.2.1 From d4d0590bef31071e8809ec046717444b95b3f30a Mon Sep 17 00:00:00 2001 From: ivan Date: Sat, 15 Oct 2005 09:11:20 +0000 Subject: import rt 3.4.4 --- rt/etc/upgrade/3.1.0/schema.Pg | 2 +- rt/etc/upgrade/3.1.0/schema.SQLite | 3 +- rt/etc/upgrade/3.3.0/acl.Informix | 4 ++ rt/etc/upgrade/3.3.0/acl.Oracle | 4 ++ rt/etc/upgrade/3.3.0/acl.Pg | 20 ++++++++++ rt/etc/upgrade/3.3.0/acl.SQLite | 4 ++ rt/etc/upgrade/3.3.0/acl.mysql | 4 ++ rt/etc/upgrade/3.3.0/content | 1 + rt/etc/upgrade/3.3.0/schema.Oracle | 65 ++++++++++++++++++++++++++++++++ rt/etc/upgrade/3.3.0/schema.Pg | 74 +++++++++++++++++++++++++++++++++++++ rt/etc/upgrade/3.3.0/schema.mysql | 65 ++++++++++++++++++++++++++++++++ rt/etc/upgrade/3.3.11/acl.Oracle | 4 ++ rt/etc/upgrade/3.3.11/acl.Pg | 4 ++ rt/etc/upgrade/3.3.11/acl.SQLite | 4 ++ rt/etc/upgrade/3.3.11/acl.mysql | 4 ++ rt/etc/upgrade/3.3.11/content | 1 + rt/etc/upgrade/3.3.11/schema.Oracle | 0 rt/etc/upgrade/3.3.11/schema.Pg | 11 ++++++ rt/etc/upgrade/3.3.11/schema.SQLite | 0 rt/etc/upgrade/3.3.11/schema.mysql | 5 +++ 20 files changed, 277 insertions(+), 2 deletions(-) create mode 100644 rt/etc/upgrade/3.3.0/acl.Informix create mode 100644 rt/etc/upgrade/3.3.0/acl.Oracle create mode 100644 rt/etc/upgrade/3.3.0/acl.Pg create mode 100644 rt/etc/upgrade/3.3.0/acl.SQLite create mode 100644 rt/etc/upgrade/3.3.0/acl.mysql create mode 100644 rt/etc/upgrade/3.3.0/content create mode 100644 rt/etc/upgrade/3.3.0/schema.Oracle create mode 100644 rt/etc/upgrade/3.3.0/schema.Pg create mode 100644 rt/etc/upgrade/3.3.0/schema.mysql create mode 100644 rt/etc/upgrade/3.3.11/acl.Oracle create mode 100644 rt/etc/upgrade/3.3.11/acl.Pg create mode 100644 rt/etc/upgrade/3.3.11/acl.SQLite create mode 100644 rt/etc/upgrade/3.3.11/acl.mysql create mode 100644 rt/etc/upgrade/3.3.11/content create mode 100644 rt/etc/upgrade/3.3.11/schema.Oracle create mode 100644 rt/etc/upgrade/3.3.11/schema.Pg create mode 100644 rt/etc/upgrade/3.3.11/schema.SQLite create mode 100644 rt/etc/upgrade/3.3.11/schema.mysql (limited to 'rt/etc/upgrade') 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 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 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; -- cgit v1.2.1