This commit was generated by cvs2svn to compensate for changes in r2523,
[freeside.git] / rt / etc / schema.pm
1 #   column, type, nullability, length, default, database-local
2
3 my $gratuitous = {
4
5 'Groups' => {
6   'columns' => [
7     'id', 'serial', '', '', '', '',
8     'Name', 'varchar', 'NULL', '16', '', '',
9     'Description', 'varchar', 'NULL', '64', '', '',
10     'Pseudo', 'integer', '', '', '0', '',
11   ],
12   'primary_key' => 'id',
13   'unique' => [ ['Name'] ],
14   'index' => [  ],
15 },
16
17 'ACL' => {
18   'columns' => [
19     'id', 'serial', '', '', '', '',
20     'PrincipalId', 'integer', 'NULL', '', '', '',
21     'PrincipalType', 'varchar', 'NULL', '25', '', '',
22     'RightName', 'varchar', 'NULL', '25', '', '',
23     'RightScope', 'varchar', 'NULL', '25', '', '',
24     'RightAppliesTo', 'integer', 'NULL', '', '', '',
25   ],
26   'primary_key' => 'id',
27   'unique' => [  ],
28   'index' => [ ['RightScope', 'PrincipalId'], 
29                ['RightScope','RightAppliesTo','RightName','PrincipalType','PrincipalId'] ],
30 },
31
32 'Watchers' => {
33   'columns' => [
34     'id', 'serial', '', '', '', '',
35     'Type', 'varchar', 'NULL', '16', '', '',
36     'Scope', 'varchar', 'NULL', '16', '', '',
37     'Value', 'integer', 'NULL', '', '', '',
38     'Email', 'varchar', 'NULL', '255', '', '',
39     'Quiet', 'integer', 'NULL', '', '', '',
40     'Owner', 'integer', 'NULL', '', '', '',
41     'Creator', 'integer', 'NULL', '', '', '',
42     'Created', 'timestamp', 'NULL', '', '', '',
43     'LastUpdatedBy', 'integer', 'NULL', '', '', '',
44     'LastUpdated', 'timestamp', 'NULL', '', '', '',
45   ],
46   'primary_key' => 'id',
47   'unique' => [  ],
48   'index' => [ ['Scope','Value','Type','Owner'] ],
49 },
50
51 'Links' => {
52   'columns' => [
53     'id', 'serial', '', '', '', '',
54     'Base', 'varchar', 'NULL', '240', '', '',
55     'Target', 'varchar', 'NULL', '240', '', '',
56     'Type', 'varchar', '', '20', '', '',
57     'LocalTarget', 'integer', 'NULL', '', '', '',
58     'LocalBase', 'integer', 'NULL', '', '', '',
59     'LastUpdatedBy', 'integer', 'NULL', '', '', '',
60     'LastUpdated', 'timestamp', 'NULL', '', '', '',
61     'Creator', 'integer', 'NULL', '', '', '',
62     'Created', 'timestamp', 'NULL', '', '', '',
63   ],
64   'primary_key' => 'id',
65   'unique' => [ ['Base', 'Target', 'Type'] ],
66   'index' => [  ],
67 },
68
69 'Users' => {
70   'columns' => [
71     'id', 'serial', '', '', '', '',
72     'Name', 'varchar', '', '120', '', '',
73     'Password', 'varchar', 'NULL', '40', '', '',
74     'Comments', 'blob', 'NULL', '', '', '',
75     'Signature', 'blob', 'NULL', '', '', '',
76     'EmailAddress', 'varchar', 'NULL', '120', '', '',
77     'FreeformContactInfo', 'blob', 'NULL', '', '', '',
78     'Organization', 'varchar', 'NULL', '200', '', '',
79     'Privileged', 'integer', 'NULL', '', '', '',
80     'RealName', 'varchar', 'NULL', '120', '', '',
81     'Nickname', 'varchar', 'NULL', '16', '', '',
82     'Lang', 'varchar', 'NULL', '16', '', '',
83     'EmailEncoding', 'varchar', 'NULL', '16', '', '',
84     'WebEncoding', 'varchar', 'NULL', '16', '', '',
85     'ExternalContactInfoId', 'varchar', 'NULL', '100', '', '',
86     'ContactInfoSystem', 'varchar', 'NULL', '30', '', '',
87     'ExternalAuthId', 'varchar', 'NULL', '100', '', '',
88     'AuthSystem', 'varchar', 'NULL', '30', '', '',
89     'Gecos', 'varchar', 'NULL', '16', '', '',
90     'HomePhone', 'varchar', 'NULL', '30', '', '',
91     'WorkPhone', 'varchar', 'NULL', '30', '', '',
92     'MobilePhone', 'varchar', 'NULL', '30', '', '',
93     'PagerPhone', 'varchar', 'NULL', '30', '', '',
94     'Address1', 'varchar', 'NULL', '200', '', '',
95     'Address2', 'varchar', 'NULL', '200', '', '',
96     'City', 'varchar', 'NULL', '100', '', '',
97     'State', 'varchar', 'NULL', '100', '', '',
98     'Zip', 'varchar', 'NULL', '16', '', '',
99     'Country', 'varchar', 'NULL', '50', '', '',
100     'Creator', 'integer', 'NULL', '', '', '',
101     'Created', 'timestamp', 'NULL', '', '', '',
102     'LastUpdatedBy', 'integer', 'NULL', '', '', '',
103     'LastUpdated', 'timestamp', 'NULL', '', '', '',
104     'Disabled', 'int2', '','','0','',
105   ],
106   'primary_key' => 'id',
107   'unique' => [ ['Name'] ],
108   'index' => [ ['Name'], 
109                ['id', 'EmailAddress'],
110                ['EmailAddress'] ],
111 },
112
113 'Tickets' => {
114   'columns' => [
115     'id', 'serial', '', '', '', '',
116     'EffectiveId', 'integer', 'NULL', '', '', '',
117     'Queue', 'integer', 'NULL', '', '', '',
118     'Type', 'varchar', 'NULL', '16', '', '',
119     'IssueStatement', 'integer', 'NULL', '', '', '',
120     'Resolution', 'integer', 'NULL', '', '', '',
121     'Owner', 'integer', 'NULL', '', '', '',
122     'Subject', 'varchar', 'NULL', '200', '[no subject]', '',
123     'InitialPriority', 'integer', 'NULL', '', '', '',
124     'FinalPriority', 'integer', 'NULL', '', '', '',
125     'Priority', 'integer', 'NULL', '', '', '',
126     'Status', 'varchar', 'NULL', '10', '', '',
127     'TimeWorked', 'integer', 'NULL', '', '', '',
128     'TimeLeft', 'integer', 'NULL', '', '', '',
129     'Told', 'timestamp', 'NULL', '', '', '',
130     'Starts', 'timestamp', 'NULL', '', '', '',
131     'Started', 'timestamp', 'NULL', '', '', '',
132     'Due', 'timestamp', 'NULL', '', '', '',
133     'Resolved', 'timestamp', 'NULL', '', '', '',
134     'LastUpdatedBy', 'integer', 'NULL', '', '', '',
135     'LastUpdated', 'timestamp', 'NULL', '', '', '',
136     'Creator', 'integer', 'NULL', '', '', '',
137     'Created', 'timestamp', 'NULL', '', '', '',
138     'Disabled', 'int2', '','','0','',
139   ],
140   'primary_key' => 'id',
141   'unique' => [ [] ],
142   'index' => [ ['Queue', 'Status'], 
143                ['Owner'], 
144                ['EffectiveId'], 
145                ['id', 'Status'], 
146                ['id', 'EffectiveId'] ],
147 },
148
149 'GroupMembers' => {
150   'columns' => [
151     'id', 'serial', '', '', '', '',
152     'GroupId', 'integer', 'NULL', '', '', '', #foreign key, Groups::id
153     'UserId', 'integer', 'NULL', '', '', '', #foreign key, Users::id
154   ],
155   'primary_key' => 'id',
156   'unique' => [ ['GroupId', 'UserId']  ],
157   'index' => [  ],
158 },
159
160 'Queues' => {
161   'columns' => [
162     'id', 'serial', '', '', '', '',
163     'Name', 'varchar', '', '120', '', '', #Textual 'name' for this queue
164     'Description', 'varchar', 'NULL', '120', '', '', #Textual descr. of this
165     #queue
166     'CorrespondAddress', 'varchar', 'NULL', '120', '', '',
167     'CommentAddress', 'varchar', 'NULL', '120', '', '',
168     'InitialPriority', 'integer', 'NULL', '', '', '',
169     'FinalPriority', 'integer', 'NULL', '', '', '',
170     'DefaultDueIn', 'integer', 'NULL', '', '', '',
171
172     'Creator', 'integer', 'NULL', '', '', '',
173     'Created', 'timestamp', 'NULL', '', '', '',
174     'LastUpdatedBy', 'integer', 'NULL', '', '', '',
175     'LastUpdated', 'timestamp', 'NULL', '', '', '',
176     'Disabled', 'int2', '','','0','',
177   ],
178   'primary_key' => 'id',
179   'unique' => [ ['Name'] ],
180   'index' => [  ],
181 },
182
183 'Transactions' => {
184   'columns' => [
185     'id', 'serial', '', '', '', '',
186     'EffectiveTicket', 'integer', 'NULL', '', '', '', 
187     'Ticket', 'integer', 'NULL', '', '', '',  #Foreign key Ticket::id
188     'TimeTaken', 'integer', 'NULL', '', '', '', #Time spent on this trans in min
189     'Type', 'varchar', 'NULL', '20', '', '',
190     'Field', 'varchar', 'NULL', '40', '', '', #If it's a "Set" transaction, what
191     #field was set.
192     'OldValue', 'varchar', 'NULL', '255', '', '', 
193     'NewValue', 'varchar', 'NULL', '255', '', '',
194     'Data', 'varchar', 'NULL', '100', '', '',
195
196
197     'Creator', 'integer', 'NULL', '', '', '',
198     'Created', 'timestamp', 'NULL', '', '', '',
199
200   ],
201   'primary_key' => 'id',
202   'unique' => [  ],
203   'index' => [ ['Ticket'], ['EffectiveTicket'] ],
204 },
205
206 'ScripActions' => {
207   'columns' => [
208                 'id', 'serial', '', '', '', '',
209                 'Name', 'varchar', 'NULL', '255', '', '',  # Alias
210                 'Description', 'varchar', 'NULL', '255', '', '', #Textual description
211                 'ExecModule', 'varchar', 'NULL', '60', '', '', #This calles RT::Action::___
212                 'Argument', 'varchar', 'NULL', '255', '', '', #We can pass a single argument
213                 #to the scrip. sometimes, it's who to send mail to.
214                 'Creator', 'integer', 'NULL', '', '', '',
215                 'Created', 'timestamp', 'NULL', '', '', '',
216                 'LastUpdatedBy', 'integer', 'NULL', '', '', '',
217                 'LastUpdated', 'timestamp', 'NULL', '', '', '',
218   ],
219   'primary_key' => 'id',
220   'unique' => [  ],
221   'index' => [  ],
222 },
223
224 'ScripConditions' => {
225   'columns' => [
226                 'id', 'serial', '', '', '', '',
227                 'Name', 'varchar', 'NULL', '255', '', '',  # Alias
228                 'Description', 'varchar', 'NULL', '255', '', '', #Textual description
229                 'ExecModule', 'varchar', 'NULL', '60', '', '', #This calles RT::Condition::
230                 'Argument', 'varchar', 'NULL', '255', '', '', #We can pass a single argument
231                 #to the scrip. sometimes, it's who to send mail to.
232                 'ApplicableTransTypes', 'varchar', 'NULL', '60', '', '',#Transaction types this scrip
233                 # acts on. comma or / delimited is just great.
234                 'Creator', 'integer', 'NULL', '', '', '',
235                 'Created', 'timestamp', 'NULL', '', '', '',
236                 'LastUpdatedBy', 'integer', 'NULL', '', '', '',
237                 'LastUpdated', 'timestamp', 'NULL', '', '', '',
238   ],
239   'primary_key' => 'id',
240   'unique' => [  ],
241   'index' => [  ],
242 },
243 'Scrips' => {
244                  'columns' => [
245                                'id', 'serial', '', '', '', '',
246                                'ScripCondition', 'integer', 'NULL', '', '', '', #Foreign key ScripConditions::id
247                                'ScripAction', 'integer', 'NULL', '', '', '', #Foreign key ScripActions::id
248                                'Stage', 'varchar', 'NULL', '32','','', #What stage does this scrip
249                                #Happen in.  for now, everything is 'TransactionCreate',
250                                'Queue', 'integer', 'NULL', '', '', '', #Foreign key Queues::id
251                                'Template', 'integer', 'NULL', '', '', '', #Foreign key Templates::id
252                                
253                                'Creator', 'integer', 'NULL', '', '', '',
254                                'Created', 'timestamp', 'NULL', '', '', '',
255                                'LastUpdatedBy', 'integer', 'NULL', '', '', '',
256                                'LastUpdated', 'timestamp', 'NULL', '', '', '',
257                               ],
258                  'primary_key' => 'id',
259                  'unique' => [  ],
260                  'index' => [  ],
261 },
262
263 'Attachments' => {
264   'columns' => [
265     'id', 'serial', '', '', '', '',
266     'TransactionId', 'integer', '', '', '', '', #Foreign key Transactions::Id
267     'Parent', 'integer', 'NULL', '', '', '', # Attachments::Id
268     'MessageId', 'varchar', 'NULL', '160', '', '', #RFC822 messageid, if any
269     'Subject', 'varchar', 'NULL', '255', '', '', 
270     'Filename', 'varchar', 'NULL', '255', '', '',
271     'ContentType', 'varchar', 'NULL', '80', '', '',
272     'ContentEncoding', 'varchar', 'NULL', '80', '', '',
273     'Content', 'long varbinary', 'NULL', '', '', '',
274     'Headers', 'long varbinary', 'NULL', '', '', '',
275
276     'Creator', 'integer', 'NULL', '', '', '',
277     'Created', 'timestamp', 'NULL', '', '', '',
278
279   ],
280   'primary_key' => 'id',
281   'unique' => [  ],
282   'index' => [ ['Parent'], ['TransactionId'], ['Parent', 'TransactionId'] ],
283 },
284
285 'Templates' => {
286   'columns' => [
287     'id', 'serial', '', '', '', '',
288     'Queue', 'integer', 'NOT NULL', '', '0', '',
289     'Name', 'varchar', '', '40', '', '',
290     'Description', 'varchar', 'NULL', '120', '', '',
291     'Type', 'varchar', 'NULL', '16', '','',
292     'Language', 'varchar', 'NULL', '16', '', '',
293     'TranslationOf', 'integer', 'NULL', '', '', '',
294     'Content', 'blob', 'NULL', '', '', '',
295     'LastUpdated', 'timestamp', 'NULL', '', '', '',
296     'LastUpdatedBy', 'integer', 'NULL', '', '', '',
297     'Creator', 'integer', 'NULL', '', '', '',
298     'Created', 'timestamp', 'NULL', '', '', '',
299   ],
300   'primary_key' => 'id',
301   'unique' => [ [''] ],
302   'index' => [  ],
303 },
304
305 'Keywords' => {
306   'columns' => [
307     'id', 'serial', '', '', '', '',
308     'Name', 'varchar', 'NOT NULL', '255', '', '',
309     'Description', 'varchar', 'NULL', '255', '', '',
310     'Parent', 'integer', 'NULL', '', '', '',
311     'Disabled', 'int2', '','','0','',
312 ],
313   'primary_key' => 'id',
314   'unique' => [ [ 'Name', 'Parent' ] ],
315   'index' => [ [ 'Name', ], [ 'Parent' ] ],
316 },
317
318 'ObjectKeywords' => {
319   'columns' =>  [
320     'id', 'serial', '', '', '', '',
321     'Keyword', 'integer', 'NOT NULL', '', '', '',
322     'KeywordSelect', 'integer', 'NOT NULL', '', '', '',
323     'ObjectType', 'varchar', 'NOT NULL', '32', '', '',
324     'ObjectId', 'integer', 'NOT NULL', '', '', '',
325   ],
326   'primary_key' => 'id',
327   'unique' => [ [  'ObjectId', 'ObjectType','KeywordSelect', 'Keyword' ] ],
328   'index' => [ [ 'ObjectId', 'ObjectType'  ] , ['Keyword'] ],
329
330 },
331
332 'KeywordSelects' => {
333   'columns' =>  [
334     'id', 'serial', '', '', '', '',
335     'Name','varchar','NULL','255','','',
336     'Keyword', 'integer', 'NULL', '', '', '',
337     'Single', 'integer', 'NULL', '', '', '',
338     'Depth', 'integer', 'NOT NULL', '', 0, '',
339     'ObjectType', 'varchar', 'NOT NULL',  '32', '', '',
340     'ObjectField', 'varchar', 'NULL', '32', '', '',
341     'ObjectValue', 'varchar', 'NULL', '255', '', '',
342     'Disabled', 'int2', '','','0','',
343   ],
344   'primary_key' => 'id',
345   'unique' => [ [ ] ],
346   'index' => [ [ 'Keyword' ], [ 'ObjectType', 'ObjectField', 'ObjectValue'] ],
347 },
348
349 };