summaryrefslogtreecommitdiff
path: root/rt/etc
diff options
context:
space:
mode:
authorIvan Kohler <ivan@freeside.biz>2012-09-23 14:56:51 -0700
committerIvan Kohler <ivan@freeside.biz>2012-09-23 14:56:51 -0700
commit0bff2e665b3a6389b47510e4c04a5a454f6dd7d4 (patch)
treee7f3368c067594b98699c5cf62f0991e8ceb2e4f /rt/etc
parent806d426d106efea2b2b13314108c4ac046511e1c (diff)
rt 4.0.7
Diffstat (limited to 'rt/etc')
-rw-r--r--rt/etc/initialdata2
-rw-r--r--rt/etc/schema.SQLite106
-rw-r--r--rt/etc/upgrade/3.3.0/schema.mysql53
-rw-r--r--rt/etc/upgrade/3.3.11/schema.mysql4
-rw-r--r--rt/etc/upgrade/3.9.5/schema.mysql24
-rw-r--r--rt/etc/upgrade/3.9.7/schema.mysql10
6 files changed, 97 insertions, 102 deletions
diff --git a/rt/etc/initialdata b/rt/etc/initialdata
index cc07cec59..7ab746db1 100644
--- a/rt/etc/initialdata
+++ b/rt/etc/initialdata
@@ -1,4 +1,4 @@
-# Initial data for a fresh RT3 Installation.
+# Initial data for a fresh RT installation.
@Users = (
{ Name => 'root',
diff --git a/rt/etc/schema.SQLite b/rt/etc/schema.SQLite
index 138971cfb..6897be2d6 100644
--- a/rt/etc/schema.SQLite
+++ b/rt/etc/schema.SQLite
@@ -3,7 +3,7 @@
CREATE TABLE Attachments (
id INTEGER PRIMARY KEY ,
TransactionId INTEGER ,
- Parent integer NULL ,
+ Parent integer NULL DEFAULT 0 ,
MessageId varchar(160) NULL ,
Subject varchar(255) NULL ,
Filename varchar(255) NULL ,
@@ -11,7 +11,7 @@ CREATE TABLE Attachments (
ContentEncoding varchar(80) NULL ,
Content LONGTEXT NULL ,
Headers LONGTEXT NULL ,
- Creator integer NULL ,
+ Creator integer NULL DEFAULT 0 ,
Created DATETIME NULL
) ;
@@ -30,12 +30,12 @@ CREATE TABLE Queues (
CommentAddress varchar(120) NULL ,
Lifecycle varchar(32) NULL ,
SubjectTag varchar(120) NULL ,
- InitialPriority integer NULL ,
- FinalPriority integer NULL ,
- DefaultDueIn integer NULL ,
- Creator integer NULL ,
+ InitialPriority integer NULL DEFAULT 0 ,
+ FinalPriority integer NULL DEFAULT 0 ,
+ DefaultDueIn integer NULL DEFAULT 0 ,
+ Creator integer NULL DEFAULT 0 ,
Created DATETIME NULL ,
- LastUpdatedBy integer NULL ,
+ LastUpdatedBy integer NULL DEFAULT 0 ,
LastUpdated DATETIME NULL ,
Disabled int2 NOT NULL DEFAULT 0
@@ -51,11 +51,11 @@ CREATE TABLE Links (
Base varchar(240) NULL ,
Target varchar(240) NULL ,
Type varchar(20) NOT NULL ,
- LocalTarget integer NULL ,
- LocalBase integer NULL ,
- LastUpdatedBy integer NULL ,
+ LocalTarget integer NULL DEFAULT 0 ,
+ LocalBase integer NULL DEFAULT 0 ,
+ LastUpdatedBy integer NULL DEFAULT 0 ,
LastUpdated DATETIME NULL ,
- Creator integer NULL ,
+ Creator integer NULL DEFAULT 0 ,
Created DATETIME NULL
) ;
@@ -106,9 +106,9 @@ CREATE TABLE ScripConditions (
Argument varchar(255) NULL ,
ApplicableTransTypes varchar(60) NULL ,
- Creator integer NULL ,
+ Creator integer NULL DEFAULT 0 ,
Created DATETIME NULL ,
- LastUpdatedBy integer NULL ,
+ LastUpdatedBy integer NULL DEFAULT 0 ,
LastUpdated DATETIME NULL
) ;
@@ -119,8 +119,8 @@ CREATE TABLE ScripConditions (
CREATE TABLE Transactions (
id INTEGER PRIMARY KEY ,
ObjectType varchar(255) NULL ,
- ObjectId integer NULL ,
- TimeTaken integer NULL ,
+ ObjectId integer NULL DEFAULT 0 ,
+ TimeTaken integer NULL DEFAULT 0 ,
Type varchar(20) NULL ,
Field varchar(40) NULL ,
OldValue varchar(255) NULL ,
@@ -130,7 +130,7 @@ CREATE TABLE Transactions (
NewReference integer NULL ,
Data varchar(255) NULL ,
- Creator integer NULL ,
+ Creator integer NULL DEFAULT 0 ,
Created DATETIME NULL
) ;
@@ -143,19 +143,19 @@ CREATE INDEX Transactions1 ON Transactions (ObjectType, ObjectId);
CREATE TABLE Scrips (
id INTEGER PRIMARY KEY ,
Description varchar(255),
- ScripCondition integer NULL ,
- ScripAction integer NULL ,
+ ScripCondition integer NULL DEFAULT 0 ,
+ ScripAction integer NULL DEFAULT 0 ,
ConditionRules text NULL ,
ActionRules text NULL ,
CustomIsApplicableCode text NULL ,
CustomPrepareCode text NULL ,
CustomCommitCode text NULL ,
Stage varchar(32) NULL ,
- Queue integer NULL ,
- Template integer NULL ,
- Creator integer NULL ,
+ Queue integer NULL DEFAULT 0 ,
+ Template integer NULL DEFAULT 0 ,
+ Creator integer NULL DEFAULT 0 ,
Created DATETIME NULL ,
- LastUpdatedBy integer NULL ,
+ LastUpdatedBy integer NULL DEFAULT 0 ,
LastUpdated DATETIME NULL
) ;
@@ -167,7 +167,7 @@ CREATE TABLE ACL (
id INTEGER PRIMARY KEY ,
PrincipalType varchar(25) NOT NULL,
- PrincipalId INTEGER,
+ PrincipalId INTEGER DEFAULT 0,
RightName varchar(25) NOT NULL ,
ObjectType varchar(25) NOT NULL ,
ObjectId INTEGER default 0,
@@ -185,8 +185,8 @@ CREATE TABLE ACL (
CREATE TABLE GroupMembers (
id INTEGER PRIMARY KEY ,
- GroupId integer NULL,
- MemberId integer NULL,
+ GroupId integer NULL DEFAULT 0,
+ MemberId integer NULL DEFAULT 0,
Creator integer NOT NULL DEFAULT 0 ,
Created DATETIME NULL ,
LastUpdatedBy integer NOT NULL DEFAULT 0 ,
@@ -250,9 +250,9 @@ CREATE TABLE Users (
Timezone char(50) NULL ,
PGPKey text NULL,
- Creator integer NULL ,
+ Creator integer NULL DEFAULT 0 ,
Created DATETIME NULL ,
- LastUpdatedBy integer NULL ,
+ LastUpdatedBy integer NULL DEFAULT 0 ,
LastUpdated DATETIME NULL
) ;
@@ -270,20 +270,20 @@ CREATE INDEX Users4 ON Users (EmailAddress);
CREATE TABLE Tickets (
id INTEGER PRIMARY KEY ,
- EffectiveId integer NULL ,
- Queue integer NULL ,
+ EffectiveId integer NULL DEFAULT 0 ,
+ Queue integer NULL DEFAULT 0 ,
Type varchar(16) NULL ,
- IssueStatement integer NULL ,
- Resolution integer NULL ,
- Owner integer NULL ,
+ IssueStatement integer NULL DEFAULT 0 ,
+ Resolution integer NULL DEFAULT 0 ,
+ Owner integer NULL DEFAULT 0 ,
Subject varchar(200) NULL DEFAULT '[no subject]' ,
- InitialPriority integer NULL ,
- FinalPriority integer NULL ,
- Priority integer NULL ,
- TimeEstimated integer NULL ,
- TimeWorked integer NULL ,
+ InitialPriority integer NULL DEFAULT 0 ,
+ FinalPriority integer NULL DEFAULt 0 ,
+ Priority integer NULL DEFAULT 0 ,
+ TimeEstimated integer NULL DEFAULT 0 ,
+ TimeWorked integer NULL DEFAULT 0 ,
Status varchar(64) NULL ,
- TimeLeft integer NULL ,
+ TimeLeft integer NULL DEFAULT 0 ,
Told DATETIME NULL ,
Starts DATETIME NULL ,
Started DATETIME NULL ,
@@ -291,9 +291,9 @@ CREATE TABLE Tickets (
Resolved DATETIME NULL ,
- LastUpdatedBy integer NULL ,
+ LastUpdatedBy integer NULL DEFAULT 0 ,
LastUpdated DATETIME NULL ,
- Creator integer NULL ,
+ Creator integer NULL DEFAULT 0 ,
Created DATETIME NULL ,
Disabled int2 NOT NULL DEFAULT 0
@@ -315,9 +315,9 @@ CREATE TABLE ScripActions (
Description varchar(255) NULL ,
ExecModule varchar(60) NULL ,
Argument varchar(255) NULL ,
- Creator integer NULL ,
+ Creator integer NULL DEFAULT 0 ,
Created DATETIME NULL ,
- LastUpdatedBy integer NULL ,
+ LastUpdatedBy integer NULL DEFAULT 0 ,
LastUpdated DATETIME NULL
) ;
@@ -333,11 +333,11 @@ CREATE TABLE Templates (
Description varchar(255) NULL ,
Type varchar(16) NULL ,
Language varchar(16) NULL ,
- TranslationOf integer NULL ,
+ TranslationOf integer NULL DEFAULT 0 ,
Content blob NULL ,
LastUpdated DATETIME NULL ,
- LastUpdatedBy integer NULL ,
- Creator integer NULL ,
+ LastUpdatedBy integer NULL DEFAULT 0 ,
+ Creator integer NULL DEFAULT 0 ,
Created DATETIME NULL
) ;
@@ -437,10 +437,10 @@ CREATE TABLE Attributes (
Content LONGTEXT NULL ,
ContentType varchar(16),
ObjectType varchar(25) NOT NULL ,
- ObjectId INTEGER default 0,
- Creator integer NULL ,
+ ObjectId INTEGER ,
+ Creator integer NULL DEFAULT 0 ,
Created DATETIME NULL ,
- LastUpdatedBy integer NULL ,
+ LastUpdatedBy integer NULL DEFAULT 0 ,
LastUpdated DATETIME NULL
) ;
@@ -483,22 +483,22 @@ Parent integer NOT NULL DEFAULT 0,
Name varchar(255) NOT NULL DEFAULT '',
Description varchar(255) NOT NULL DEFAULT '',
ObjectType varchar(64) NOT NULL DEFAULT '',
-ObjectId integer NOT NULL
+ObjectId integer NOT NULL DEFAULT 0
);
CREATE TABLE ObjectTopics (
id INTEGER PRIMARY KEY,
-Topic integer NOT NULL,
+Topic integer NOT NULL DEFAULT 0,
ObjectType varchar(64) NOT NULL DEFAULT '',
-ObjectId integer NOT NULL
+ObjectId integer NOT NULL DEFAULT 0
);
CREATE TABLE ObjectClasses (
id INTEGER PRIMARY KEY,
-Class integer NOT NULL,
+Class integer NOT NULL DEFAULT 0,
ObjectType varchar(64) NOT NULL DEFAULT '',
-ObjectId integer NOT NULL,
+ObjectId integer NOT NULL DEFAULT 0,
Creator integer NOT NULL DEFAULT 0,
Created TIMESTAMP NULL,
LastUpdatedBy integer NOT NULL DEFAULT 0,
diff --git a/rt/etc/upgrade/3.3.0/schema.mysql b/rt/etc/upgrade/3.3.0/schema.mysql
index f6998363e..d8b04991e 100644
--- a/rt/etc/upgrade/3.3.0/schema.mysql
+++ b/rt/etc/upgrade/3.3.0/schema.mysql
@@ -1,37 +1,32 @@
-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 ;
+drop index transactions1 ON Transactions;
-CREATE INDEX Transactions1 ON Transactions (ObjectType, ObjectId);
-
-alter table TicketCustomFieldValues rename ObjectCustomFieldValues;
+alter Table Transactions
+ ADD COLUMN (ObjectType varchar(64) not null),
+ DROP COLUMN EffectiveTicket,
+ ADD COLUMN ReferenceType varchar(255) NULL,
+ ADD COLUMN OldReference integer NULL,
+ ADD COLUMN NewReference integer NULL,
+ CHANGE Ticket ObjectId integer NOT NULL DEFAULT 0;
-alter table ObjectCustomFieldValues change Ticket ObjectId integer NOT NULL DEFAULT 0 ;
+UPDATE Transactions set ObjectType = 'RT::Ticket';
+CREATE INDEX Transactions1 ON Transactions (ObjectType, ObjectId);
-alter table ObjectCustomFieldValues add column ObjectType varchar(255) not null;
+alter table TicketCustomFieldValues rename ObjectCustomFieldValues,
+ change Ticket ObjectId integer NOT NULL DEFAULT 0 ,
+ add column ObjectType varchar(255) not null,
+ add column Current bool default 1,
+ add column LargeContent LONGTEXT NULL,
+ add column ContentType varchar(80) NULL,
+ add column ContentEncoding varchar(80) 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);
+alter table ObjectCustomFieldValues add index ObjectCustomFieldValues1 (Content),
+ add index ObjectCustomFieldValues2 (CustomField,ObjectType,ObjectId);
CREATE TABLE ObjectCustomFields (
@@ -50,10 +45,10 @@ CREATE TABLE ObjectCustomFields (
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 add column LookupType varchar(255) NOT NULL,
+ add column Repeated int2 NOT NULL DEFAULT 0 ,
+ add column Pattern varchar(255) NULL,
+ add column MaxValues integer;
# See above
# alter table CustomFields drop index CustomFields1;
@@ -62,4 +57,4 @@ 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;
+alter table CustomFields drop column Queue;
diff --git a/rt/etc/upgrade/3.3.11/schema.mysql b/rt/etc/upgrade/3.3.11/schema.mysql
index cc35d40f2..eff84783f 100644
--- a/rt/etc/upgrade/3.3.11/schema.mysql
+++ b/rt/etc/upgrade/3.3.11/schema.mysql
@@ -1,5 +1,5 @@
-ALTER TABLE ObjectCustomFieldValues ADD COLUMN SortOrder INTEGER NOT NULL DEFAULT 0;
-ALTER TABLE ObjectCustomFieldValues ADD COLUMN Disabled int2 NOT NULL DEFAULT 0;
+ALTER TABLE ObjectCustomFieldValues ADD COLUMN SortOrder INTEGER NOT NULL DEFAULT 0,
+ ADD COLUMN Disabled int2 NOT NULL DEFAULT 0;
UPDATE ObjectCustomFieldValues SET Disabled = 1 WHERE Current = 0;
ALTER TABLE ObjectCustomFieldValues DROP COLUMN Current;
diff --git a/rt/etc/upgrade/3.9.5/schema.mysql b/rt/etc/upgrade/3.9.5/schema.mysql
index 4bd0907c0..fe5018c78 100644
--- a/rt/etc/upgrade/3.9.5/schema.mysql
+++ b/rt/etc/upgrade/3.9.5/schema.mysql
@@ -6,15 +6,15 @@ AND CustomFieldValues.id = Attributes.ObjectId);
DELETE FROM Attributes WHERE Name = 'Category' AND ObjectType = 'RT::CustomFieldValue';
-ALTER TABLE Groups ADD COLUMN Creator integer NOT NULL DEFAULT 0;
-ALTER TABLE Groups ADD COLUMN Created DATETIME NULL;
-ALTER TABLE Groups ADD COLUMN LastUpdatedBy integer NOT NULL DEFAULT 0;
-ALTER TABLE Groups ADD COLUMN LastUpdated DATETIME NULL;
-ALTER TABLE GroupMembers ADD COLUMN Creator integer NOT NULL DEFAULT 0;
-ALTER TABLE GroupMembers ADD COLUMN Created DATETIME NULL;
-ALTER TABLE GroupMembers ADD COLUMN LastUpdatedBy integer NOT NULL DEFAULT 0;
-ALTER TABLE GroupMembers ADD COLUMN LastUpdated DATETIME NULL;
-ALTER TABLE ACL ADD COLUMN Creator integer NOT NULL DEFAULT 0;
-ALTER TABLE ACL ADD COLUMN Created DATETIME NULL;
-ALTER TABLE ACL ADD COLUMN LastUpdatedBy integer NOT NULL DEFAULT 0;
-ALTER TABLE ACL ADD COLUMN LastUpdated DATETIME NULL;
+ALTER TABLE Groups ADD COLUMN Creator integer NOT NULL DEFAULT 0,
+ ADD COLUMN Created DATETIME NULL,
+ ADD COLUMN LastUpdatedBy integer NOT NULL DEFAULT 0,
+ ADD COLUMN LastUpdated DATETIME NULL;
+ALTER TABLE GroupMembers ADD COLUMN Creator integer NOT NULL DEFAULT 0,
+ ADD COLUMN Created DATETIME NULL,
+ ADD COLUMN LastUpdatedBy integer NOT NULL DEFAULT 0,
+ ADD COLUMN LastUpdated DATETIME NULL;
+ALTER TABLE ACL ADD COLUMN Creator integer NOT NULL DEFAULT 0,
+ ADD COLUMN Created DATETIME NULL,
+ ADD COLUMN LastUpdatedBy integer NOT NULL DEFAULT 0,
+ ADD COLUMN LastUpdated DATETIME NULL;
diff --git a/rt/etc/upgrade/3.9.7/schema.mysql b/rt/etc/upgrade/3.9.7/schema.mysql
index 1be165647..4cbed6cc7 100644
--- a/rt/etc/upgrade/3.9.7/schema.mysql
+++ b/rt/etc/upgrade/3.9.7/schema.mysql
@@ -1,6 +1,6 @@
ALTER TABLE Users ADD COLUMN AuthToken VARCHAR(16) CHARACTER SET ascii NULL;
-ALTER TABLE CustomFields ADD COLUMN BasedOn INTEGER NULL;
-ALTER TABLE CustomFields ADD COLUMN RenderType VARCHAR(64) NULL;
-ALTER TABLE CustomFields ADD COLUMN ValuesClass VARCHAR(64) CHARACTER SET ascii NULL;
-ALTER TABLE Queues ADD COLUMN SubjectTag VARCHAR(120) NULL;
-ALTER TABLE Queues ADD COLUMN Lifecycle VARCHAR(32) NULL;
+ALTER TABLE CustomFields ADD COLUMN BasedOn INTEGER NULL,
+ ADD COLUMN RenderType VARCHAR(64) NULL,
+ ADD COLUMN ValuesClass VARCHAR(64) CHARACTER SET ascii NULL;
+ALTER TABLE Queues ADD COLUMN SubjectTag VARCHAR(120) NULL,
+ ADD COLUMN Lifecycle VARCHAR(32) NULL;