[Rt-commit] [svn] r766 - in rt/branches/rt-3.3/etc/upgrade: . 3.3.0
jesse at pallas.eruditorum.org
jesse at pallas.eruditorum.org
Wed Apr 28 14:26:02 EDT 2004
Author: jesse
Date: Wed Apr 28 14:26:02 2004
New Revision: 766
Added:
rt/branches/rt-3.3/etc/upgrade/3.3.0/
rt/branches/rt-3.3/etc/upgrade/3.3.0/acl.Informix
rt/branches/rt-3.3/etc/upgrade/3.3.0/acl.Oracle
rt/branches/rt-3.3/etc/upgrade/3.3.0/acl.Pg
rt/branches/rt-3.3/etc/upgrade/3.3.0/acl.SQLite
rt/branches/rt-3.3/etc/upgrade/3.3.0/acl.mysql
rt/branches/rt-3.3/etc/upgrade/3.3.0/schema.Pg
rt/branches/rt-3.3/etc/upgrade/3.3.0/schema.mysql
Modified:
rt/branches/rt-3.3/etc/upgrade/ (props changed)
Log:
----------------------------------------------------------------------
r2206 at tinbook: jesse | 2004-04-28T18:24:56.988760Z
Added the beginnings of upgrade 3.1->3.3 functionality. has not yet been tested
----------------------------------------------------------------------
Added: rt/branches/rt-3.3/etc/upgrade/3.3.0/acl.Informix
==============================================================================
--- (empty file)
+++ rt/branches/rt-3.3/etc/upgrade/3.3.0/acl.Informix Wed Apr 28 14:26:02 2004
@@ -0,0 +1,4 @@
+sub acl {
+ return ();
+}
+1;
Added: rt/branches/rt-3.3/etc/upgrade/3.3.0/acl.Oracle
==============================================================================
--- (empty file)
+++ rt/branches/rt-3.3/etc/upgrade/3.3.0/acl.Oracle Wed Apr 28 14:26:02 2004
@@ -0,0 +1,4 @@
+sub acl {
+ return ();
+}
+1;
Added: rt/branches/rt-3.3/etc/upgrade/3.3.0/acl.Pg
==============================================================================
--- (empty file)
+++ rt/branches/rt-3.3/etc/upgrade/3.3.0/acl.Pg Wed Apr 28 14:26:02 2004
@@ -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;
Added: rt/branches/rt-3.3/etc/upgrade/3.3.0/acl.SQLite
==============================================================================
--- (empty file)
+++ rt/branches/rt-3.3/etc/upgrade/3.3.0/acl.SQLite Wed Apr 28 14:26:02 2004
@@ -0,0 +1,4 @@
+sub acl {
+ return ();
+}
+1;
Added: rt/branches/rt-3.3/etc/upgrade/3.3.0/acl.mysql
==============================================================================
--- (empty file)
+++ rt/branches/rt-3.3/etc/upgrade/3.3.0/acl.mysql Wed Apr 28 14:26:02 2004
@@ -0,0 +1,4 @@
+sub acl {
+ return ();
+}
+1;
Added: rt/branches/rt-3.3/etc/upgrade/3.3.0/schema.Pg
==============================================================================
--- (empty file)
+++ rt/branches/rt-3.3/etc/upgrade/3.3.0/schema.Pg Wed Apr 28 14:26:02 2004
@@ -0,0 +1,75 @@
+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;
+
+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;
+
+drop index ticketcustomfieldvalues1;
+
+drop index ticketcustomfieldvalues2;
+
+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 (id, CustomField, ObjectId, SortOrder, Creator, LastUpdatedBy) SELECT null, 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;
+ALTER TABLE CustomFields ALTER COLUMN Repeated SET DEFAULT 0;
+ALTER TABLE CustomFields ALTER COLUMN Repeated SET NOT NULL;
+alter table CustomFields drop column Queue;
Added: rt/branches/rt-3.3/etc/upgrade/3.3.0/schema.mysql
==============================================================================
--- (empty file)
+++ rt/branches/rt-3.3/etc/upgrade/3.3.0/schema.mysql Wed Apr 28 14:26:02 2004
@@ -0,0 +1,64 @@
+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;
+
+alter table objectcustomfieldvalues drop index ticketcustomfieldvalues1;
+
+alter table objectcustomfieldvalues drop index ticketcustomfieldvalues2;
+
+alter table objectcustomfieldvalues add index ObjectCustomFieldValues1 (CustomField,ObjectType,ObjectId,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;
+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;
More information about the Rt-commit
mailing list