This commit was generated by cvs2svn to compensate for changes in r4407,
[freeside.git] / rt / docs / design_docs / 3.3-schema-redesign.txt
1 -- --------------------------------------- --
2 --  RT 3.3 Schema redesign v7: 2004-11-08  --
3 -- --------------------------------------- --
4
5 TABLE CustomFields (
6   id INTEGER NOT NULL  AUTO_INCREMENT,
7   Name varchar(200) NULL  ,
8   Type varchar(200) NULL  ,                 -- Changed: see MaxValues below
9   MaxValues integer,                        -- New: 1 = Single, 0 = Multiple
10   Pattern varchar(255) NULL  ,              -- New: regex to validate against
11   Repeated int2 NOT NULL DEFAULT 0 ,        -- New: repeated table entry
12   LookupType varchar(255) NOT NULL,         -- New: "RT::Queue-RT::Ticket"
13   Description varchar(255) NULL  ,
14   SortOrder integer NOT NULL DEFAULT 0  ,   -- only used on "pick CF" screen
15 )
16
17 -- This table replaces the "Queue" field in CustomFields
18 TABLE ObjectCustomFields (
19   id INTEGER NOT NULL  AUTO_INCREMENT,
20   CustomField int NOT NULL  ,               -- CustomField ID
21   ObjectId integer NOT NULL,                -- Final id of toplevel parent, or 
22                                             -- the object itself if ParentType
23                                             -- is empty; 0 means global as usual
24   SortOrder integer NOT NULL DEFAULT 0  ,   -- this is used to sort the CFs
25 );
26
27 -- This table replaces TicketCustomFieldValues
28 TABLE ObjectCustomFieldValues (
29   id INTEGER NOT NULL  AUTO_INCREMENT,
30   CustomField int NOT NULL  ,
31   ObjectType varchar(255) NOT NULL,         -- Final target of the Object
32   ObjectId int NOT NULL  ,                  -- New: replaces the "Ticket" field
33   SortOrder integer NOT NULL DEFAULT 0  ,   -- New: for Repeated fields
34
35   Content varchar(255) NULL  ,
36   LargeContent LONGTEXT NULL,               -- New: data longer than 255 bytes
37   ContentType varchar(80) NULL,             -- New: MIME type of LargeContent
38   ContentEncoding varchar(80) NULL  ,       -- New: for binary LargeContent
39   Disabled int2 NOT NULL DEFAULT 0 ,        -- New: whether this is deleted
40 )
41
42 TABLE Transactions (
43   id INTEGER NOT NULL  AUTO_INCREMENT,
44   ObjectType varchar(255) NULL,             -- Final target of the Object
45   ObjectId integer NOT NULL DEFAULT 0  ,    -- New: replaces the "Ticket" field
46   TimeTaken integer NOT NULL DEFAULT 0  ,
47   Type varchar(20) NULL  ,
48   Field varchar(40) NULL  ,
49   OldValue varchar(255) NULL  ,
50   NewValue varchar(255) NULL  ,
51   ReferenceType varchar(255) NULL,          -- NeW: Currently "RT::OCFV" only
52   OldReference integer NULL  ,              -- New: Id of ReferenceType
53   NewReference integer NULL  ,              -- New: Id of ReferenceType
54   Data varchar(255) NULL  ,
55 )
56
57 -- vim: filetype=mysql shiftwidth=4 expandtab