summaryrefslogtreecommitdiff
path: root/rt/etc/schema.Pg
diff options
context:
space:
mode:
Diffstat (limited to 'rt/etc/schema.Pg')
-rwxr-xr-xrt/etc/schema.Pg68
1 files changed, 18 insertions, 50 deletions
diff --git a/rt/etc/schema.Pg b/rt/etc/schema.Pg
index 2d45a94..a5b68b3 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 integer NOT NULL DEFAULT 0 ,
+ Disabled int2 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 integer NOT NULL DEFAULT 0 ,
+ Disabled int2 NOT NULL DEFAULT 0 ,
PRIMARY KEY (id)
);
@@ -183,16 +183,13 @@ CREATE SEQUENCE transactions_id_seq;
CREATE TABLE Transactions (
id INTEGER DEFAULT nextval('transactions_id_seq'),
- ObjectType varchar(255) NOT NULL ,
- ObjectId integer NOT NULL DEFAULT 0 ,
+ EffectiveTicket integer NOT NULL DEFAULT 0 ,
+ Ticket 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 ,
@@ -200,7 +197,8 @@ CREATE TABLE Transactions (
PRIMARY KEY (id)
);
-CREATE INDEX Transactions1 ON Transactions (ObjectType, ObjectId);
+CREATE INDEX Transactions1 ON Transactions (Ticket);
+CREATE INDEX Transactions2 ON Transactions (EffectiveTicket);
-- }}}
@@ -301,7 +299,7 @@ CREATE TABLE CachedGroupMembers (
MemberId int,
Via int,
ImmediateParentId int,
- Disabled integer NOT NULL DEFAULT 0 ,
+ Disabled int2 NOT NULL DEFAULT 0 ,
PRIMARY KEY (id)
);
@@ -408,7 +406,7 @@ CREATE TABLE Tickets (
LastUpdated TIMESTAMP NULL ,
Creator integer NOT NULL DEFAULT 0 ,
Created TIMESTAMP NULL ,
- Disabled integer NOT NULL DEFAULT 0 ,
+ Disabled int2 NOT NULL DEFAULT 0 ,
PRIMARY KEY (id)
);
@@ -476,7 +474,7 @@ CREATE TABLE Templates (
-- }}}
--- {{{ ObjectCustomFieldValues
+-- {{{ TicketCustomFieldValues
@@ -484,31 +482,24 @@ CREATE TABLE Templates (
-- Sequences for table TICKETCUSTOMFIELDVALUES
--
-CREATE SEQUENCE objectcustomfieldvalues_id_s;
+CREATE SEQUENCE ticketcustomfieldvalues_id_s;
-CREATE TABLE ObjectCustomFieldValues (
- id INTEGER DEFAULT nextval('objectcustomfieldvalues_id_s'),
+CREATE TABLE TicketCustomFieldValues (
+ id INTEGER DEFAULT nextval('ticketcustomfieldvalues_id_s'),
+ Ticket int NOT NULL ,
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 ObjectCustomFieldValues1 ON ObjectCustomFieldValues (CustomField,ObjectType,ObjectId,Content);
-CREATE INDEX ObjectCustomFieldValues2 ON ObjectCustomFieldValues (CustomField,ObjectType,ObjectId);
+CREATE INDEX TicketCustomFieldValues1 ON TicketCustomFieldValues (CustomField,Ticket,Content);
+CREATE INDEX TicketCustomFieldValues2 ON TicketCustomFieldValues (CustomField,Ticket);
-- }}}
@@ -526,10 +517,7 @@ CREATE TABLE CustomFields (
id INTEGER DEFAULT nextval('customfields_id_seq'),
Name varchar(200) NULL ,
Type varchar(200) NULL ,
- MaxValues integer NOT NULL DEFAULT 0 ,
- Repeated integer NOT NULL DEFAULT 0 ,
- Pattern varchar(255) NULL ,
- LookupType varchar(255) NOT NULL ,
+ Queue integer NOT NULL DEFAULT 0 ,
Description varchar(255) NULL ,
SortOrder integer NOT NULL DEFAULT 0 ,
@@ -537,27 +525,7 @@ CREATE TABLE CustomFields (
Created TIMESTAMP NULL ,
LastUpdatedBy integer NOT NULL DEFAULT 0 ,
LastUpdated TIMESTAMP NULL ,
- 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 ,
+ Disabled int2 NOT NULL DEFAULT 0 ,
PRIMARY KEY (id)
);
@@ -605,7 +573,7 @@ CREATE TABLE Attributes (
Content text,
ContentType varchar(16),
ObjectType varchar(64),
- ObjectId integer,
+ ObjectId integer, # foreign key to anything
Creator integer NOT NULL DEFAULT 0 ,
Created TIMESTAMP NULL ,
LastUpdatedBy integer NOT NULL DEFAULT 0 ,