bc619f856fcea7b4a8d57bdaa7b7bca3de44078a
[tine20] / tine20 / Tinebase / Setup / setup.xml
1 <?xml version="1.0" encoding="utf-8"?>
2 <application>
3     <name>Tinebase</name>
4     <version>8.10</version>
5     <tables>
6         <table>
7             <name>applications</name>
8             <version>3</version>
9             <declaration>
10                 <field>
11                     <name>id</name>
12                     <type>text</type>
13                     <length>40</length>
14                     <notnull>true</notnull>
15                 </field>
16                 <field>
17                     <name>name</name>
18                     <type>text</type>
19                     <length>25</length>
20                     <notnull>true</notnull>
21                 </field>
22                 <field>
23                     <name>status</name>
24                     <type>text</type>
25                     <length>32</length>
26                     <default>enabled</default>
27                     <notnull>true</notnull>
28                 </field>
29                 <field>
30                     <name>order</name>
31                     <type>integer</type>
32                     <notnull>true</notnull>
33                 </field>
34                 <field>
35                     <name>version</name>
36                     <type>text</type>
37                     <length>20</length>
38                     <notnull>true</notnull>
39                 </field>
40                 <index>
41                     <name>id</name>
42                     <primary>true</primary>
43                     <field>
44                         <name>id</name>
45                     </field>
46                 </index>
47                 <index>
48                     <name>name</name>
49                     <unique>true</unique>
50                     <field>
51                         <name>name</name>
52                     </field>
53                 </index>
54                 <index>
55                     <name>status</name>
56                     <field>
57                         <name>status</name>
58                     </field>
59                 </index>
60             </declaration>
61         </table>
62
63         <table>
64             <name>application_tables</name>
65             <version>1</version>
66             <declaration>
67                 <field>
68                     <name>application_id</name>
69                     <type>text</type>
70                     <length>40</length>
71                     <notnull>true</notnull>
72                 </field>
73                 <field>
74                     <name>name</name>
75                     <type>text</type>
76                     <length>128</length>
77                     <notnull>true</notnull>
78                 </field>
79                 <field>
80                     <name>version</name>
81                     <type>text</type>
82                     <length>20</length>
83                     <notnull>true</notnull>
84                 </field>
85                 <index>
86                     <name>name-application_id</name>
87                     <primary>true</primary>
88                     <field>
89                         <name>application_id</name>
90                     </field>
91                     <field>
92                         <name>name</name>
93                     </field>
94                 </index>
95                 <index>
96                     <name>application_tables::application_id--applications::id</name>
97                     <field>
98                         <name>application_id</name>
99                     </field>
100                     <foreign>true</foreign>
101                     <reference>
102                         <table>applications</table>
103                         <field>id</field>
104                         <ondelete>cascade</ondelete>
105                         <!-- add onupdate? -->
106                     </reference>
107                 </index>
108             </declaration>
109         </table>
110
111         <!-- credential_cache -->
112         <table>
113             <name>credential_cache</name>
114             <version>1</version>
115             <declaration>
116                 <field>
117                     <name>id</name>
118                     <type>text</type>
119                     <length>40</length>
120                     <notnull>true</notnull>
121                 </field>
122                 <field>
123                     <name>cache</name>
124                     <type>clob</type>
125                     <notnull>true</notnull>
126                 </field>
127                 <field>
128                     <name>creation_time</name>
129                     <type>datetime</type>
130                 </field>
131                 <field>
132                     <name>valid_until</name>
133                     <type>datetime</type>
134                 </field>
135                 <index>
136                     <name>id</name>
137                     <primary>true</primary>
138                     <field>
139                         <name>id</name>
140                     </field>
141                 </index>
142             </declaration>
143         </table>
144
145         <table>
146             <name>groups</name>
147             <version>5</version>
148             <declaration>
149                 <field>
150                     <name>id</name>
151                     <type>text</type>
152                     <length>40</length>
153                     <notnull>true</notnull>
154                 </field>
155                 <field>
156                     <name>name</name>
157                     <type>text</type>
158                     <length>128</length>
159                     <notnull>true</notnull>
160                 </field>
161                 <field>
162                     <name>description</name>
163                     <type>text</type>
164                     <length>255</length>
165                     <notnull>false</notnull>
166                 </field>
167                 <field>
168                     <name>visibility</name>
169                     <type>text</type>
170                     <length>32</length>
171                     <default>displayed</default>
172                     <notnull>true</notnull>
173                 </field>
174                 <field>
175                     <name>email</name>
176                     <type>text</type>
177                     <length>64</length>
178                 </field>
179                 <field>
180                     <name>list_id</name>
181                     <type>text</type>
182                     <length>40</length>
183                 </field>
184                 <field>
185                     <name>created_by</name>
186                     <type>text</type>
187                     <length>40</length>
188                 </field>
189                 <field>
190                     <name>creation_time</name>
191                     <type>datetime</type>
192                 </field>
193                 <field>
194                     <name>last_modified_by</name>
195                     <type>text</type>
196                     <length>40</length>
197                 </field>
198                 <field>
199                     <name>last_modified_time</name>
200                     <type>datetime</type>
201                 </field>
202                 <field>
203                     <name>is_deleted</name>
204                     <type>boolean</type>
205                     <default>false</default>
206                 </field>
207                 <field>
208                     <name>deleted_by</name>
209                     <type>text</type>
210                     <length>40</length>
211                 </field>
212                 <field>
213                     <name>deleted_time</name>
214                     <type>datetime</type>
215                 </field>
216                 <field>
217                     <name>seq</name>
218                     <type>integer</type>
219                     <notnull>true</notnull>
220                     <default>0</default>
221                 </field>
222                 <index>
223                     <name>id</name>
224                     <primary>true</primary>
225                     <field>
226                         <name>id</name>
227                     </field>
228                 </index>
229                 <index>
230                     <name>name</name>
231                     <unique>true</unique>
232                     <field>
233                         <name>name</name>
234                     </field>
235                 </index>
236                 <index>
237                     <name>list_id</name>
238                     <field>
239                         <name>list_id</name>
240                     </field>
241                 </index>
242             </declaration>
243         </table>
244
245         <table>
246             <name>accounts</name>
247             <version>11</version>
248             <declaration>
249                 <field>
250                     <name>id</name>
251                     <type>text</type>
252                     <length>40</length>
253                     <notnull>true</notnull>
254                 </field>
255                 <field>
256                     <name>login_name</name>
257                     <type>text</type>
258                     <length>255</length>
259                     <notnull>true</notnull>
260                 </field>
261                 <field>
262                     <name>password</name>
263                     <type>text</type>
264                     <length>100</length>
265                     <notnull>false</notnull>
266                 </field>
267                 <field>
268                     <name>login_shell</name>
269                     <type>text</type>
270                     <length>100</length>
271                     <notnull>false</notnull>
272                 </field>
273                 <field>
274                     <name>home_dir</name>
275                     <type>text</type>
276                     <length>255</length>
277                     <notnull>false</notnull>
278                 </field>
279                 <field>
280                     <name>last_login</name>
281                     <type>datetime</type>
282                 </field>
283                 <field>
284                     <name>last_login_from</name>
285                     <type>text</type>
286                     <length>39</length>
287                     <notnull>false</notnull>
288                 </field>
289                 <field>
290                     <name>last_password_change</name>
291                     <type>datetime</type>
292                 </field>
293                 <field>
294                     <name>status</name>
295                     <type>text</type>
296                     <length>20</length>
297                     <default>enabled</default>
298                     <notnull>true</notnull>
299                 </field>
300                 <field>
301                     <name>expires_at</name>
302                     <type>datetime</type>
303                 </field>
304                 <field>
305                     <name>blocked_until</name>
306                     <type>datetime</type>
307                 </field>
308                 <field>
309                     <name>login_failures</name>
310                     <type>integer</type>
311                     <default>0</default>
312                 </field>
313                 <field>
314                     <name>last_login_failure_at</name>
315                     <type>datetime</type>
316                 </field>
317                 <field>
318                     <name>primary_group_id</name>
319                     <type>text</type>
320                     <length>40</length>
321                     <notnull>true</notnull>
322                 </field>
323                 <field>
324                     <name>openid</name>
325                     <type>text</type>
326                     <length>254</length>
327                 </field>
328                 <field>
329                     <name>visibility</name>
330                     <type>text</type>
331                     <length>32</length>
332                     <default>displayed</default>
333                     <notnull>true</notnull>
334                 </field>
335                 <field>
336                     <name>email</name>
337                     <type>text</type>
338                     <length>255</length>
339                 </field>
340                 <field>
341                     <name>first_name</name>
342                     <type>text</type>
343                     <length>255</length>
344                 </field>
345                 <field>
346                     <name>last_name</name>
347                     <type>text</type>
348                     <length>255</length>
349                     <notnull>true</notnull>
350                 </field>
351                 <field>
352                     <name>full_name</name>
353                     <type>text</type>
354                     <length>255</length>
355                     <notnull>true</notnull>
356                 </field>
357                 <field>
358                     <name>display_name</name>
359                     <type>text</type>
360                     <length>255</length>
361                     <notnull>true</notnull>
362                 </field>
363                 <field>
364                     <name>contact_id</name>
365                     <type>text</type>
366                     <length>40</length>
367                 </field>
368                 <field>
369                     <name>created_by</name>
370                     <type>text</type>
371                     <length>40</length>
372                 </field>
373                 <field>
374                     <name>creation_time</name>
375                     <type>datetime</type>
376                 </field>
377                 <field>
378                     <name>last_modified_by</name>
379                     <type>text</type>
380                     <length>40</length>
381                 </field>
382                 <field>
383                     <name>last_modified_time</name>
384                     <type>datetime</type>
385                 </field>
386                 <field>
387                     <name>is_deleted</name>
388                     <type>boolean</type>
389                     <default>false</default>
390                 </field>
391                 <field>
392                     <name>deleted_by</name>
393                     <type>text</type>
394                     <length>40</length>
395                 </field>
396                 <field>
397                     <name>deleted_time</name>
398                     <type>datetime</type>
399                 </field>
400                 <field>
401                     <name>seq</name>
402                     <type>integer</type>
403                     <notnull>true</notnull>
404                     <default>0</default>
405                 </field>
406                 <index>
407                     <name>id</name>
408                     <primary>true</primary>
409                     <field>
410                         <name>id</name>
411                     </field>
412                 </index>
413                 <index>
414                     <name>login_name</name>
415                     <unique>true</unique>
416                     <field>
417                         <name>login_name</name>
418                     </field>
419                 </index>
420                 <index>
421                     <name>openid</name>
422                     <unique>true</unique>
423                     <field>
424                         <name>openid</name>
425                     </field>
426                 </index>
427                 <index>
428                     <name>visibility</name>
429                     <field>
430                         <name>visibility</name>
431                     </field>
432                 </index>
433                 <index>
434                     <name>primary_group_id</name>
435                     <field>
436                         <name>primary_group_id</name>
437                     </field>
438                 </index>
439                 <index>
440                     <name>contact_id</name>
441                     <field>
442                         <name>contact_id</name>
443                     </field>
444                 </index>
445                 <index>
446                     <name>accounts::primary_group_id--groups::id</name>
447                     <field>
448                         <name>primary_group_id</name>
449                     </field>
450                     <foreign>true</foreign>
451                     <reference>
452                         <table>groups</table>
453                         <field>id</field>
454                     </reference>
455                 </index>
456             </declaration>
457         </table>
458
459         <table>
460             <name>group_members</name>
461             <version>1</version>
462             <declaration>
463                 <field>
464                     <name>group_id</name>
465                     <type>text</type>
466                     <length>40</length>
467                     <notnull>true</notnull>
468                 </field>
469                 <field>
470                     <name>account_id</name>
471                     <type>text</type>
472                     <length>40</length>
473                     <notnull>true</notnull>
474                 </field>
475
476                 <index>
477                     <name>group_id-account_id</name>
478                     <primary>true</primary>
479                     <field>
480                         <name>group_id</name>
481                     </field>
482                     <field>
483                         <name>account_id</name>
484                     </field>
485                 </index>
486                 <index>
487                     <name>account_id</name>
488                     <field>
489                         <name>account_id</name>
490                     </field>
491                 </index>
492                 <index>
493                     <name>group_members::account_id--accounts::id</name>
494                     <field>
495                         <name>account_id</name>
496                     </field>
497                     <foreign>true</foreign>
498                     <reference>
499                         <table>accounts</table>
500                         <field>id</field>
501                     </reference>
502                 </index>
503                 <index>
504                     <name>group_members::group_id--groups::id</name>
505                     <field>
506                         <name>group_id</name>
507                     </field>
508                     <foreign>true</foreign>
509                     <reference>
510                         <table>groups</table>
511                         <field>id</field>
512                     </reference>
513                 </index>
514             </declaration>
515         </table>
516         <table>
517             <name>container</name>
518             <version>9</version>
519             <declaration>
520                 <field>
521                     <name>id</name>
522                     <type>integer</type>
523                     <autoincrement>true</autoincrement>
524                 </field>
525                 <field>
526                     <name>name</name>
527                     <type>text</type>
528                     <length>255</length>
529                     <notnull>true</notnull>
530                 </field>
531                 <field>
532                     <name>type</name>
533                     <type>text</type>
534                     <length>32</length>
535                     <default>personal</default>
536                     <notnull>false</notnull>
537                 </field>
538                 <field>
539                     <name>color</name>
540                     <type>text</type>
541                     <length>7</length>
542                     <default>NULL</default>
543                 </field>
544                 <field>
545                     <name>backend</name>
546                     <type>text</type>
547                     <length>64</length>
548                     <notnull>true</notnull>
549                 </field>
550                 <field>
551                     <name>application_id</name>
552                     <type>text</type>
553                     <length>40</length>
554                     <notnull>true</notnull>
555                 </field>
556                 <field>
557                     <name>content_seq</name>
558                     <type>integer</type>
559                     <length>64</length>
560                 </field>
561                 <field>
562                     <name>created_by</name>
563                     <type>text</type>
564                     <length>40</length>
565                 </field>
566                 <field>
567                     <name>creation_time</name>
568                     <type>datetime</type>
569                 </field>
570                 <field>
571                     <name>last_modified_by</name>
572                     <type>text</type>
573                     <length>40</length>
574                 </field>
575                 <field>
576                     <name>last_modified_time</name>
577                     <type>datetime</type>
578                 </field>
579                 <field>
580                     <name>is_deleted</name>
581                     <type>boolean</type>
582                     <default>false</default>
583                 </field>
584                 <field>
585                     <name>deleted_by</name>
586                     <type>text</type>
587                     <length>40</length>
588                 </field>
589                 <field>
590                     <name>deleted_time</name>
591                     <type>datetime</type>
592                 </field>
593                 <field>
594                     <name>seq</name>
595                     <type>integer</type>
596                     <notnull>true</notnull>
597                     <default>0</default>
598                 </field>
599                 <field>
600                     <name>model</name>
601                     <type>text</type>
602                     <length>64</length>
603                 </field>
604                 <field>
605                     <name>uuid</name>
606                     <type>text</type>
607                     <length>64</length>
608                     <default>NULL</default>
609                 </field>
610                 <index>
611                     <name>id</name>
612                     <primary>true</primary>
613                     <field>
614                         <name>id</name>
615                     </field>
616                 </index>
617                 <index>
618                     <name>type</name>
619                     <field>
620                         <name>type</name>
621                     </field>
622                 </index>
623                 <index>
624                     <name>application_id</name>
625                     <field>
626                         <name>application_id</name>
627                     </field>
628                 </index>
629                 <index>
630                     <name>container::application_id--applications::id</name>
631                     <field>
632                         <name>application_id</name>
633                     </field>
634                     <foreign>true</foreign>
635                     <reference>
636                         <table>applications</table>
637                         <field>id</field>
638                     </reference>
639                 </index>
640             </declaration>
641         </table>
642         <table>
643             <name>container_acl</name>
644             <version>3</version>
645             <declaration>
646                 <field>
647                     <name>id</name>
648                     <type>text</type>
649                     <length>40</length>
650                     <notnull>true</notnull>
651                 </field>
652                 <field>
653                     <name>container_id</name>
654                     <type>integer</type>
655                     <unsigned>true</unsigned>
656                     <notnull>true</notnull>
657                 </field>
658                 <field>
659                     <name>account_type</name>
660                     <type>text</type>
661                     <length>32</length>
662                     <default>user</default>
663                     <notnull>true</notnull>
664                 </field>
665                 <field>
666                     <name>account_id</name>
667                     <type>text</type>
668                     <length>40</length>
669                     <notnull>true</notnull>
670                 </field>
671                 <field>
672                     <name>account_grant</name>
673                     <type>text</type>
674                     <length>40</length>
675                     <notnull>true</notnull>
676                 </field>
677
678                 <index>
679                     <name>container_id-account-type-account_id-account_grant</name>
680                     <primary>true</primary>
681                     <field>
682                         <name>id</name>
683                     </field>
684                     <field>
685                         <name>container_id</name>
686                     </field>
687                     <field>
688                         <name>account_type</name>
689                     </field>
690                     <field>
691                         <name>account_id</name>
692                     </field>
693                     <field>
694                         <name>account_grant</name>
695                     </field>
696                 </index>
697                 <index>
698                     <name>id-account_type-account_id</name>
699                     <field>
700                         <name>container_id</name>
701                     </field>
702                     <field>
703                         <name>account_type</name>
704                     </field>
705                     <field>
706                         <name>account_id</name>
707                     </field>
708                 </index>
709                 <index>
710                     <name>container_acl::container_id--container::id</name>
711                     <field>
712                         <name>container_id</name>
713                     </field>
714                     <foreign>true</foreign>
715                     <reference>
716                         <table>container</table>
717                         <field>id</field>
718                         <ondelete>cascade</ondelete>
719                         <!-- add onupdate? -->
720                     </reference>
721                 </index>
722             </declaration>
723         </table>
724         <table>
725             <name>container_content</name>
726             <version>2</version>
727             <declaration>
728                 <field>
729                     <name>id</name>
730                     <type>text</type>
731                     <length>40</length>
732                     <notnull>true</notnull>
733                 </field>
734                 <field>
735                     <name>container_id</name>
736                     <type>integer</type>
737                     <unsigned>true</unsigned>
738                     <notnull>true</notnull>
739                 </field>
740                 <field>
741                     <name>record_id</name>
742                     <type>text</type>
743                     <length>40</length>
744                     <notnull>true</notnull>
745                 </field>
746                 <field>
747                     <name>action</name>
748                     <type>text</type>
749                     <length>16</length>
750                     <notnull>true</notnull>
751                 </field>
752                 <field>
753                     <name>content_seq</name>
754                     <type>integer</type>
755                     <length>64</length>
756                 </field>
757                 <field>
758                     <name>time</name>
759                     <type>datetime</type>
760                     <notnull>true</notnull>
761                 </field>
762                 <index>
763                     <name>container_id-content_seq-record_id</name>
764                     <primary>true</primary>
765                     <field>
766                         <name>container_id</name>
767                     </field>
768                     <field>
769                         <name>content_seq</name>
770                     </field>
771                     <field>
772                         <name>record_id</name>
773                     </field>
774                 </index>
775                 <index>
776                     <name>id</name>
777                     <field>
778                         <name>id</name>
779                     </field>
780                 </index>
781                 <index>
782                     <name>container_content::container_id--container::id</name>
783                     <field>
784                         <name>container_id</name>
785                     </field>
786                     <foreign>true</foreign>
787                     <reference>
788                         <table>container</table>
789                         <field>id</field>
790                         <ondelete>cascade</ondelete>
791                     </reference>
792                 </index>
793             </declaration>
794         </table>
795         <table>
796             <name>access_log</name>
797             <version>5</version>
798             <declaration>
799                 <field>
800                     <name>id</name>
801                     <type>text</type>
802                     <length>40</length>
803                     <notnull>true</notnull>
804                 </field>
805                 <field>
806                     <name>sessionid</name>
807                     <type>text</type>
808                     <length>128</length>
809                     <notnull>true</notnull>
810                 </field>
811                 <field>
812                     <name>login_name</name>
813                     <type>text</type>
814                     <length>64</length>
815                     <notnull>true</notnull>
816                 </field>
817                 <field>
818                     <name>ip</name>
819                     <type>text</type>
820                     <length>40</length>
821                     <notnull>false</notnull>
822                 </field>
823                 <field>
824                     <name>li</name>
825                     <type>datetime</type>
826                     <notnull>true</notnull>
827                 </field>
828                 <field>
829                     <name>lo</name>
830                     <type>datetime</type>
831                 </field>
832                 <field>
833                     <name>account_id</name>
834                     <type>text</type>
835                     <length>40</length>
836                     <notnull>false</notnull>
837                 </field>
838                 <field>
839                     <name>result</name>
840                     <type>integer</type>
841                     <notnull>true</notnull>
842                     <unsigned>false</unsigned>
843                 </field>
844                 <field>
845                     <name>clienttype</name>
846                     <type>text</type>
847                     <length>128</length>
848                     <notnull>false</notnull>
849                 </field>
850                 <field>
851                     <name>user_agent</name>
852                     <type>text</type>
853                     <length>255</length>
854                 </field>
855                 <index>
856                     <name>id</name>
857                     <primary>true</primary>
858                     <field>
859                         <name>id</name>
860                     </field>
861                 </index>
862                 <index>
863                     <name>sessionid</name>
864                     <field>
865                         <name>sessionid</name>
866                     </field>
867                 </index>
868                 <index>
869                     <name>li</name>
870                     <field>
871                         <name>li</name>
872                     </field>
873                 </index>
874                 <index>
875                     <name>account_id-ip</name>
876                     <field>
877                         <name>account_id</name>
878                     </field>
879                     <field>
880                         <name>ip</name>
881                     </field>
882                 </index>
883             </declaration>
884         </table>
885
886         <table>
887             <name>record_observer</name>
888             <version>3</version>
889             <declaration>
890                 <field>
891                     <name>id</name>
892                     <type>integer</type>
893                     <autoincrement>true</autoincrement>
894                 </field>
895                 <field>
896                     <name>observable_application</name>
897                     <type>integer</type>
898                     <notnull>true</notnull>
899                 </field>
900                 <field>
901                     <name>observable_identifier</name>
902                     <type>integer</type>
903                     <notnull>true</notnull>
904                 </field>
905                 <field>
906                     <name>observer_application</name>
907                     <type>integer</type>
908                 </field>
909                 <field>
910                     <name>observer_identifier</name>
911                     <type>integer</type>
912                 </field>
913                 <field>
914                     <name>observed_event</name>
915                     <type>text</type>
916                     <length>64</length>
917                     <notnull>false</notnull>
918                 </field>
919                 <field>
920                     <name>created_by</name>
921                     <type>text</type>
922                     <length>40</length>
923                 </field>
924                 <field>
925                     <name>creation_time</name>
926                     <type>datetime</type>
927                     <notnull>true</notnull>
928                 </field>
929                 <field>
930                     <name>last_modified_by</name>
931                     <type>text</type>
932                     <length>40</length>
933                     <notnull>true</notnull>
934                 </field>
935                 <field>
936                     <name>last_modified_time</name>
937                     <type>datetime</type>
938                     <notnull>true</notnull>
939                 </field>
940                 <field>
941                     <name>is_deleted</name>
942                     <type>boolean</type>
943                     <notnull>true</notnull>
944                     <default>false</default>
945                 </field>
946                 <field>
947                     <name>deleted_by</name>
948                     <type>text</type>
949                     <length>40</length>
950                     <notnull>true</notnull>
951                 </field>
952                 <field>
953                     <name>deleted_time</name>
954                     <type>datetime</type>
955                 </field>
956                 <field>
957                     <name>seq</name>
958                     <type>integer</type>
959                     <notnull>true</notnull>
960                     <default>0</default>
961                 </field>
962                 <index>
963                     <name>id</name>
964                     <primary>true</primary>
965                     <field>
966                         <name>id</name>
967                     </field>
968                 </index>
969                 <index>
970                     <name>observable_id-observer_id-application_id</name>
971                     <unique>true</unique>
972                     <field>
973                         <name>observable_application</name>
974                     </field>
975                     <field>
976                         <name>observable_identifier</name>
977                     </field>
978                     <field>
979                         <name>observer_identifier</name>
980                     </field>
981                     <field>
982                         <name>observed_event</name>
983                     </field>
984                 </index>
985                 <index>
986                     <name>observer_application</name>
987                     <field>
988                         <name>observer_application</name>
989                     </field>
990                 </index>
991                 <index>
992                     <name>observer_identifier</name>
993                     <field>
994                         <name>observer_identifier</name>
995                     </field>
996                 </index>
997
998             </declaration>
999         </table>
1000
1001         <table>
1002             <name>relations</name>
1003             <version>7</version>
1004             <declaration>
1005                 <field>
1006                     <name>id</name>
1007                     <type>text</type>
1008                     <length>40</length>
1009                     <notnull>true</notnull>
1010                 </field>
1011                 <field>
1012                     <name>rel_id</name>
1013                     <type>text</type>
1014                     <length>40</length>
1015                     <notnull>true</notnull>
1016                 </field>
1017                 <field>
1018                     <name>own_model</name>
1019                     <type>text</type>
1020                     <length>40</length>
1021                     <notnull>true</notnull>
1022                 </field>
1023                 <field>
1024                     <name>own_backend</name>
1025                     <type>text</type>
1026                     <length>40</length>
1027                     <notnull>true</notnull>
1028                 </field>
1029                 <field>
1030                     <name>own_id</name>
1031                     <type>text</type>
1032                     <length>40</length>
1033                     <notnull>true</notnull>
1034                 </field>
1035                 <field>
1036                     <name>own_degree</name>
1037                     <type>text</type>
1038                     <length>32</length>
1039                     <notnull>true</notnull>
1040                 </field>
1041                 <field>
1042                     <name>related_model</name>
1043                     <type>text</type>
1044                     <length>40</length>
1045                     <notnull>true</notnull>
1046                 </field>
1047                 <field>
1048                     <name>related_backend</name>
1049                     <type>text</type>
1050                     <length>40</length>
1051                     <notnull>true</notnull>
1052                 </field>
1053                 <field>
1054                     <name>related_id</name>
1055                     <type>text</type>
1056                     <length>40</length>
1057                     <notnull>true</notnull>
1058                 </field>
1059                 <field>
1060                     <name>type</name>
1061                     <type>text</type>
1062                     <length>40</length>
1063                     <notnull>true</notnull>
1064                 </field>
1065                 <field>
1066                     <name>remark</name>
1067                     <type>text</type>
1068                 </field>
1069                 <field>
1070                     <name>created_by</name>
1071                     <type>text</type>
1072                     <length>40</length>
1073                     <notnull>false</notnull>
1074                 </field>
1075                 <field>
1076                     <name>creation_time</name>
1077                     <type>datetime</type>
1078                     <notnull>false</notnull>
1079                 </field>
1080                 <field>
1081                     <name>last_modified_by</name>
1082                     <type>text</type>
1083                     <length>40</length>
1084                     <notnull>false</notnull>
1085                 </field>
1086                 <field>
1087                     <name>last_modified_time</name>
1088                     <type>datetime</type>
1089                     <notnull>false</notnull>
1090                 </field>
1091                 <field>
1092                     <name>is_deleted</name>
1093                     <type>boolean</type>
1094                     <notnull>true</notnull>
1095                     <default>false</default>
1096                 </field>
1097                 <field>
1098                     <name>deleted_by</name>
1099                     <type>text</type>
1100                     <length>40</length>
1101                     <notnull>false</notnull>
1102                 </field>
1103                 <field>
1104                     <name>deleted_time</name>
1105                     <type>datetime</type>
1106                     <notnull>false</notnull>
1107                 </field>
1108                 <field>
1109                     <name>seq</name>
1110                     <type>integer</type>
1111                     <notnull>true</notnull>
1112                     <default>0</default>
1113                 </field>
1114                 <index>
1115                     <name>id</name>
1116                     <primary>true</primary>
1117                     <field>
1118                         <name>id</name>
1119                     </field>
1120                 </index>
1121                 <index>
1122                     <name>rel_id-own_model-own_backend-own_id</name>
1123                     <unique>true</unique>
1124                     <field>
1125                         <name>rel_id</name>
1126                     </field>
1127                     <field>
1128                         <name>own_model</name>
1129                     </field>
1130                     <field>
1131                         <name>own_backend</name>
1132                     </field>
1133                     <field>
1134                         <name>own_id</name>
1135                     </field>
1136                 </index>
1137                 <index>
1138                     <name>unique-fields</name>
1139                     <unique>true</unique>
1140                     <field>
1141                         <name>own_model</name>
1142                     </field>
1143                     <field>
1144                         <name>own_backend</name>
1145                     </field>
1146                     <field>
1147                         <name>own_id</name>
1148                     </field>
1149                     <field>
1150                         <name>related_model</name>
1151                     </field>
1152                     <field>
1153                         <name>related_backend</name>
1154                     </field>
1155                     <field>
1156                         <name>related_id</name>
1157                     </field>
1158                 </index>
1159             </declaration>
1160         </table>
1161
1162         <table>
1163             <name>timemachine_modlog</name>
1164             <version>3</version>
1165             <declaration>
1166                 <field>
1167                     <name>id</name>
1168                     <type>text</type>
1169                     <length>40</length>
1170                     <notnull>true</notnull>
1171                 </field>
1172                 <field>
1173                     <name>application_id</name>
1174                     <type>text</type>
1175                     <length>40</length>
1176                     <notnull>true</notnull>
1177                 </field>
1178                 <field>
1179                     <name>record_id</name>
1180                     <type>text</type>
1181                     <length>40</length>
1182                     <notnull>false</notnull>
1183                 </field>
1184                 <field>
1185                     <name>record_type</name>
1186                     <type>text</type>
1187                     <length>64</length>
1188                     <notnull>false</notnull>
1189                 </field>
1190                 <field>
1191                     <name>record_backend</name>
1192                     <type>text</type>
1193                     <length>64</length>
1194                     <notnull>false</notnull>
1195                 </field>
1196                 <field>
1197                     <name>modification_time</name>
1198                     <type>datetime</type>
1199                     <notnull>true</notnull>
1200                 </field>
1201                 <field>
1202                     <name>modification_account</name>
1203                     <type>text</type>
1204                     <length>40</length>
1205                     <notnull>true</notnull>
1206                 </field>
1207                 <field>
1208                     <name>modified_attribute</name>
1209                     <type>text</type>
1210                     <length>64</length>
1211                     <notnull>false</notnull>
1212                 </field>
1213                 <field>
1214                     <name>old_value</name>
1215                     <type>clob</type>
1216                 </field>
1217                 <field>
1218                     <name>new_value</name>
1219                     <type>clob</type>
1220                 </field>
1221                 <field>
1222                     <name>seq</name>
1223                     <type>integer</type>
1224                     <length>64</length>
1225                 </field>
1226                 <index>
1227                     <name>id</name>
1228                     <primary>true</primary>
1229                     <field>
1230                         <name>id</name>
1231                     </field>
1232                 </index>
1233                 <index>
1234                     <name>seq</name>
1235                     <field>
1236                         <name>seq</name>
1237                     </field>
1238                 </index>
1239                 <index>
1240                     <name>unique-fields</name>
1241                     <unique>true</unique>
1242                     <field>
1243                         <name>application_id</name>
1244                     </field>
1245                     <field>
1246                         <name>record_id</name>
1247                     </field>
1248                     <field>
1249                         <name>record_type</name>
1250                     </field>
1251                     <field>
1252                         <name>modification_time</name>
1253                     </field>
1254                     <field>
1255                         <name>modification_account</name>
1256                     </field>
1257                     <field>
1258                         <name>modified_attribute</name>
1259                     </field>
1260                     <field>
1261                         <name>seq</name>
1262                     </field>
1263                 </index>
1264             </declaration>
1265         </table>
1266
1267         <table>
1268             <name>tags</name>
1269             <version>7</version>
1270             <declaration>
1271                 <field>
1272                     <name>id</name>
1273                     <type>text</type>
1274                     <length>40</length>
1275                     <notnull>true</notnull>
1276                 </field>
1277                 <field>
1278                     <name>type</name>
1279                     <type>text</type>
1280                     <length>32</length>
1281                     <notnull>true</notnull>
1282                 </field>
1283                 <field>
1284                     <name>owner</name>
1285                     <type>text</type>
1286                     <length>40</length>
1287                 </field>
1288                 <field>
1289                     <name>name</name>
1290                     <type>text</type>
1291                     <length>255</length>
1292                     <default>NULL</default>
1293                 </field>
1294                 <field>
1295                     <name>description</name>
1296                     <type>text</type>
1297                     <length>255</length>
1298                     <default>NULL</default>
1299                 </field>
1300                 <field>
1301                     <name>color</name>
1302                     <type>text</type>
1303                     <length>7</length>
1304                     <default>NULL</default>
1305                 </field>
1306                 <field>
1307                     <name>occurrence</name>
1308                     <type>integer</type>
1309                 </field>
1310                 <field>
1311                     <name>created_by</name>
1312                     <type>text</type>
1313                     <length>40</length>
1314                 </field>
1315                 <field>
1316                     <name>creation_time</name>
1317                     <type>datetime</type>
1318                 </field>
1319                 <field>
1320                     <name>last_modified_by</name>
1321                     <type>text</type>
1322                     <length>40</length>
1323                 </field>
1324                 <field>
1325                     <name>last_modified_time</name>
1326                     <type>datetime</type>
1327                 </field>
1328                 <field>
1329                     <name>is_deleted</name>
1330                     <type>boolean</type>
1331                     <notnull>true</notnull>
1332                     <default>false</default>
1333                 </field>
1334                 <field>
1335                     <name>deleted_by</name>
1336                     <type>text</type>
1337                     <length>40</length>
1338                 </field>
1339                 <field>
1340                     <name>deleted_time</name>
1341                     <type>datetime</type>
1342                 </field>
1343                 <field>
1344                     <name>seq</name>
1345                     <type>integer</type>
1346                     <notnull>true</notnull>
1347                     <default>0</default>
1348                 </field>
1349                 <index>
1350                     <name>id</name>
1351                     <primary>true</primary>
1352                     <field>
1353                         <name>id</name>
1354                     </field>
1355                 </index>
1356                 <index>
1357                     <name>owner</name>
1358                     <field>
1359                         <name>owner</name>
1360                     </field>
1361                 </index>
1362                 <index>
1363                     <name>name</name>
1364                     <field>
1365                         <name>name</name>
1366                     </field>
1367                 </index>
1368             </declaration>
1369         </table>
1370
1371         <table>
1372             <name>tags_acl</name>
1373             <version>2</version>
1374             <declaration>
1375                 <field>
1376                     <name>tag_id</name>
1377                     <type>text</type>
1378                     <length>40</length>
1379                     <notnull>true</notnull>
1380                 </field>
1381                 <field>
1382                     <name>account_type</name>
1383                     <type>text</type>
1384                     <length>32</length>
1385                     <default>user</default>
1386                     <notnull>true</notnull>
1387                 </field>
1388                 <field>
1389                     <name>account_id</name>
1390                     <type>text</type>
1391                     <length>40</length>
1392                     <notnull>true</notnull>
1393                 </field>
1394                 <field>
1395                     <name>account_right</name>
1396                     <type>text</type>
1397                     <length>10</length>
1398                     <notnull>true</notnull>
1399                 </field>
1400                 <index>
1401                     <name>tag_id-account_type-account_id-account_right</name>
1402                     <primary>true</primary>
1403                     <field>
1404                         <name>tag_id</name>
1405                     </field>
1406                     <field>
1407                         <name>account_type</name>
1408                     </field>
1409                     <field>
1410                         <name>account_id</name>
1411                     </field>
1412                     <field>
1413                         <name>account_right</name>
1414                     </field>
1415                 </index>
1416                 <index>
1417                     <name>tag_id-account_type-account_id</name>
1418                     <field>
1419                         <name>tag_id</name>
1420                     </field>
1421                     <field>
1422                         <name>account_type</name>
1423                     </field>
1424                     <field>
1425                         <name>account_id</name>
1426                     </field>
1427                 </index>
1428                 <index>
1429                     <name>tags_acl::tag_id--tags::id</name>
1430                     <field>
1431                         <name>tag_id</name>
1432                     </field>
1433                     <foreign>true</foreign>
1434                     <reference>
1435                         <table>tags</table>
1436                         <field>id</field>
1437                     </reference>
1438                 </index>
1439             </declaration>
1440         </table>
1441
1442         <table>
1443             <name>tags_context</name>
1444             <version>1</version>
1445             <declaration>
1446                 <field>
1447                     <name>tag_id</name>
1448                     <type>text</type>
1449                     <length>40</length>
1450                     <notnull>true</notnull>
1451                 </field>
1452                 <field>
1453                     <name>application_id</name>
1454                     <type>text</type>
1455                     <length>40</length>
1456                     <notnull>true</notnull>
1457                 </field>
1458                 <index>
1459                     <name>tag_id-application_id</name>
1460                     <primary>true</primary>
1461                     <field>
1462                         <name>tag_id</name>
1463                     </field>
1464                     <field>
1465                         <name>application_id</name>
1466                     </field>
1467                 </index>
1468                 <index>
1469                     <name>application_id</name>
1470                     <field>
1471                         <name>application_id</name>
1472                     </field>
1473                 </index>
1474                 <index>
1475                     <name>tags_context::tag_id--tags::id</name>
1476                     <field>
1477                         <name>tag_id</name>
1478                     </field>
1479                     <foreign>true</foreign>
1480                     <reference>
1481                         <table>tags</table>
1482                         <field>id</field>
1483                         <!-- add onupdate/ondelete? -->
1484                     </reference>
1485                 </index>
1486
1487             </declaration>
1488         </table>
1489
1490         <table>
1491             <name>tagging</name>
1492             <version>1</version>
1493             <declaration>
1494                 <field>
1495                     <name>tag_id</name>
1496                     <type>text</type>
1497                     <length>40</length>
1498                     <notnull>true</notnull>
1499                 </field>
1500                 <field>
1501                     <name>application_id</name>
1502                     <type>text</type>
1503                     <length>40</length>
1504                     <notnull>true</notnull>
1505                 </field>
1506                 <field>
1507                     <name>record_id</name>
1508                     <type>text</type>
1509                     <length>40</length>
1510                     <notnull>true</notnull>
1511                 </field>
1512                 <field>
1513                     <name>record_backend_id</name>
1514                     <type>text</type>
1515                     <length>40</length>
1516                     <notnull>true</notnull>
1517                 </field>
1518                 <index>
1519                     <name>tag_id-application_id-record_id-record_backend_id</name>
1520                     <primary>true</primary>
1521                     <field>
1522                         <name>tag_id</name>
1523                     </field>
1524                     <field>
1525                         <name>application_id</name>
1526                     </field>
1527                     <field>
1528                         <name>record_id</name>
1529                     </field>
1530                     <field>
1531                         <name>record_backend_id</name>
1532                     </field>
1533                 </index>
1534
1535                 <index>
1536                     <name>application_id</name>
1537                     <field>
1538                         <name>application_id</name>
1539                     </field>
1540                 </index>
1541                 <index>
1542                     <name>record_id</name>
1543                     <field>
1544                         <name>record_id</name>
1545                     </field>
1546                 </index>
1547                 <index>
1548                     <name>tagging::tag_id--tags::id</name>
1549                     <field>
1550                         <name>tag_id</name>
1551                     </field>
1552                     <foreign>true</foreign>
1553                     <reference>
1554                         <table>tags</table>
1555                         <field>id</field>
1556                         <!-- add onupdate/ondelete? -->
1557                     </reference>
1558                 </index>
1559             </declaration>
1560         </table>
1561
1562         <table>
1563             <name>roles</name>
1564             <version>1</version>
1565             <declaration>
1566                 <field>
1567                     <name>id</name>
1568                     <type>integer</type>
1569                     <autoincrement>true</autoincrement>
1570                 </field>
1571                 <field>
1572                     <name>name</name>
1573                     <type>text</type>
1574                     <length>128</length>
1575                     <notnull>true</notnull>
1576                 </field>
1577                 <field>
1578                     <name>description</name>
1579                     <type>text</type>
1580                     <length>255</length>
1581                     <notnull>false</notnull>
1582                 </field>
1583                 <field>
1584                     <name>created_by</name>
1585                     <type>text</type>
1586                     <length>40</length>
1587                 </field>
1588                 <field>
1589                     <name>creation_time</name>
1590                     <type>datetime</type>
1591                 </field>
1592                 <field>
1593                     <name>last_modified_by</name>
1594                     <type>text</type>
1595                     <length>40</length>
1596                 </field>
1597                 <field>
1598                     <name>last_modified_time</name>
1599                     <type>datetime</type>
1600                 </field>
1601
1602                 <index>
1603                     <name>id</name>
1604                     <primary>true</primary>
1605                     <field>
1606                         <name>id</name>
1607                     </field>
1608                 </index>
1609                 <index>
1610                     <name>name</name>
1611                     <unique>true</unique>
1612                     <field>
1613                         <name>name</name>
1614                     </field>
1615                 </index>
1616             </declaration>
1617         </table>
1618
1619         <table>
1620             <name>role_rights</name>
1621             <version>1</version>
1622             <declaration>
1623                 <field>
1624                     <name>id</name>
1625                     <type>integer</type>
1626                     <autoincrement>true</autoincrement>
1627                 </field>
1628                 <field>
1629                     <name>role_id</name>
1630                     <type>integer</type>
1631                     <unsigned>true</unsigned>
1632                     <notnull>true</notnull>
1633                 </field>
1634                 <field>
1635                     <name>application_id</name>
1636                     <type>text</type>
1637                     <length>40</length>
1638                     <notnull>true</notnull>
1639                 </field>
1640                 <field>
1641                     <name>right</name>
1642                     <type>text</type>
1643                     <length>64</length>
1644                     <notnull>true</notnull>
1645                 </field>
1646
1647                 <index>
1648                     <name>id</name>
1649                     <primary>true</primary>
1650                     <field>
1651                         <name>id</name>
1652                     </field>
1653                 </index>
1654                 <index>
1655                     <name>role_id</name>
1656                     <field>
1657                         <name>role_id</name>
1658                     </field>
1659                 </index>
1660                 <index>
1661                     <name>application_id</name>
1662                     <field>
1663                         <name>application_id</name>
1664                     </field>
1665                 </index>
1666                 <index>
1667                     <name>role_rights::application_id--applications::id</name>
1668                     <field>
1669                         <name>application_id</name>
1670                     </field>
1671                     <foreign>true</foreign>
1672                     <reference>
1673                         <table>applications</table>
1674                         <field>id</field>
1675                         <!-- add onupdate/ondelete? -->
1676                     </reference>
1677                 </index>
1678                 <index>
1679                     <name>role_rights::role_id--roles::id</name>
1680                     <field>
1681                         <name>role_id</name>
1682                     </field>
1683                     <foreign>true</foreign>
1684                     <reference>
1685                         <table>roles</table>
1686                         <field>id</field>
1687                         <!-- add onupdate/ondelete? -->
1688                     </reference>
1689                 </index>
1690
1691
1692             </declaration>
1693         </table>
1694
1695         <table>
1696             <name>role_accounts</name>
1697             <version>2</version>
1698             <declaration>
1699                 <field>
1700                     <name>id</name>
1701                     <type>integer</type>
1702                     <autoincrement>true</autoincrement>
1703                 </field>
1704                 <field>
1705                     <name>role_id</name>
1706                     <type>integer</type>
1707                     <unsigned>true</unsigned>
1708                     <notnull>true</notnull>
1709                 </field>
1710                 <field>
1711                     <name>account_type</name>
1712                     <type>text</type>
1713                     <length>32</length>
1714                     <default>user</default>
1715                     <notnull>true</notnull>
1716                 </field>
1717                 <field>
1718                     <name>account_id</name>
1719                     <type>text</type>
1720                     <length>40</length>
1721                     <notnull>false</notnull>
1722                 </field>
1723
1724                 <index>
1725                     <name>id</name>
1726                     <primary>true</primary>
1727                     <field>
1728                         <name>id</name>
1729                     </field>
1730                 </index>
1731                 <index>
1732                     <name>account_id-account_type-role_id</name>
1733                     <unique>true</unique>
1734                     <field>
1735                         <name>role_id</name>
1736                     </field>
1737                     <field>
1738                         <name>account_id</name>
1739                     </field>
1740                     <field>
1741                         <name>account_type</name>
1742                     </field>
1743                 </index>
1744                 <index>
1745                     <name>role_accounts::role_id--roles::id</name>
1746                     <field>
1747                         <name>role_id</name>
1748                     </field>
1749                     <foreign>true</foreign>
1750                     <reference>
1751                         <table>roles</table>
1752                         <field>id</field>
1753                         <!-- add onupdate/ondelete? -->
1754                     </reference>
1755                 </index>
1756             </declaration>
1757         </table>
1758
1759         <table>
1760             <name>temp_files</name>
1761             <version>1</version>
1762             <declaration>
1763                 <field>
1764                     <name>id</name>
1765                     <type>text</type>
1766                     <length>40</length>
1767                     <notnull>true</notnull>
1768                 </field>
1769                 <field>
1770                     <name>session_id</name>
1771                     <type>text</type>
1772                     <notnull>true</notnull>
1773                 </field>
1774                 <field>
1775                     <name>time</name>
1776                     <type>datetime</type>
1777                 </field>
1778                 <field>
1779                     <name>path</name>
1780                     <type>text</type>
1781                     <notnull>true</notnull>
1782                 </field>
1783                 <field>
1784                     <name>name</name>
1785                     <type>text</type>
1786                     <notnull>true</notnull>
1787                 </field>
1788                 <field>
1789                     <name>type</name>
1790                     <type>text</type>
1791                     <notnull>true</notnull>
1792                 </field>
1793                 <field>
1794                     <name>error</name>
1795                     <type>integer</type>
1796                     <notnull>true</notnull>
1797                 </field>
1798                 <field>
1799                     <name>size</name>
1800                     <type>integer</type>
1801                     <unsigned>true</unsigned>
1802                     <notnull>true</notnull>
1803                 </field>
1804
1805                 <index>
1806                     <name>id</name>
1807                     <primary>true</primary>
1808                     <field>
1809                         <name>id</name>
1810                     </field>
1811                 </index>
1812             </declaration>
1813         </table>
1814
1815         <table>
1816             <name>config</name>
1817             <version>1</version>
1818             <declaration>
1819                 <field>
1820                     <name>id</name>
1821                     <type>text</type>
1822                     <length>40</length>
1823                     <notnull>true</notnull>
1824                 </field>
1825                 <field>
1826                     <name>application_id</name>
1827                     <type>text</type>
1828                     <length>40</length>
1829                     <notnull>true</notnull>
1830                 </field>
1831                 <field>
1832                     <name>name</name>
1833                     <type>text</type>
1834                     <length>255</length>
1835                     <notnull>true</notnull>
1836                 </field>
1837                 <field>
1838                     <name>value</name>
1839                     <type>text</type>
1840                     <notnull>true</notnull>
1841                 </field>
1842                 <index>
1843                     <name>id</name>
1844                     <primary>true</primary>
1845                     <field>
1846                         <name>id</name>
1847                     </field>
1848                 </index>
1849                 <index>
1850                     <name>application_id-name</name>
1851                     <unique>true</unique>
1852                     <field>
1853                         <name>application_id</name>
1854                     </field>
1855                     <field>
1856                         <name>name</name>
1857                     </field>
1858                 </index>
1859                 <index>
1860                     <name>config::application_id--applications::id</name>
1861                     <field>
1862                         <name>application_id</name>
1863                     </field>
1864                     <foreign>true</foreign>
1865                     <reference>
1866                         <table>applications</table>
1867                         <field>id</field>
1868                         <!-- add onupdate/ondelete? -->
1869                     </reference>
1870                 </index>
1871             </declaration>
1872         </table>
1873         <table>
1874             <name>preferences</name>
1875             <version>7</version>
1876             <declaration>
1877                 <field>
1878                     <name>id</name>
1879                     <type>text</type>
1880                     <length>40</length>
1881                     <notnull>true</notnull>
1882                 </field>
1883                 <field>
1884                     <name>account_type</name>
1885                     <type>text</type>
1886                     <length>32</length>
1887                     <default>user</default>
1888                     <notnull>true</notnull>
1889                 </field>
1890                 <field>
1891                     <name>account_id</name>
1892                     <type>text</type>
1893                     <length>40</length>
1894                     <notnull>false</notnull>
1895                 </field>
1896                 <field>
1897                     <name>application_id</name>
1898                     <type>text</type>
1899                     <length>40</length>
1900                     <notnull>true</notnull>
1901                 </field>
1902                 <field>
1903                     <name>name</name>
1904                     <type>text</type>
1905                     <length>100</length>
1906                     <notnull>true</notnull>
1907                 </field>
1908                 <field>
1909                     <name>value</name>
1910                     <type>text</type>
1911                     <notnull>true</notnull>
1912                 </field>
1913                 <field>
1914                     <name>type</name>
1915                     <type>text</type>
1916                     <length>40</length>
1917                 </field>
1918                 <field>
1919                     <name>options</name>
1920                     <type>text</type>
1921                 </field>
1922                 <field>
1923                     <name>personal_only</name>
1924                     <type>boolean</type>
1925                 </field>
1926                 <index>
1927                     <name>id</name>
1928                     <primary>true</primary>
1929                     <field>
1930                         <name>id</name>
1931                     </field>
1932                 </index>
1933                 <index>
1934                     <name>app_id-name-account_id-account_type</name>
1935                     <unique>true</unique>
1936                     <field>
1937                         <name>application_id</name>
1938                     </field>
1939                     <field>
1940                         <name>name</name>
1941                     </field>
1942                     <field>
1943                         <name>account_id</name>
1944                     </field>
1945                     <field>
1946                         <name>account_type</name>
1947                     </field>
1948                 </index>
1949                 <index>
1950                     <name>preferences::application_id--applications::id</name>
1951                     <field>
1952                         <name>application_id</name>
1953                     </field>
1954                     <foreign>true</foreign>
1955                     <reference>
1956                         <table>applications</table>
1957                         <field>id</field>
1958                         <ondelete>cascade</ondelete>
1959                         <!-- add onupdate/ondelete? -->
1960                     </reference>
1961                 </index>
1962                 <index>
1963                     <name>name</name>
1964                     <field>
1965                         <name>name</name>
1966                     </field>
1967                 </index>
1968                 <index>
1969                     <name>account_id</name>
1970                     <field>
1971                         <name>account_id</name>
1972                     </field>
1973                 </index>
1974                 <index>
1975                     <name>application_id</name>
1976                     <field>
1977                         <name>application_id</name>
1978                     </field>
1979                 </index>
1980             </declaration>
1981         </table>
1982         <table>
1983             <name>customfield</name>
1984             <version>3</version>
1985             <declaration>
1986                 <field>
1987                     <name>id</name>
1988                     <type>text</type>
1989                     <length>40</length>
1990                     <notnull>true</notnull>
1991                 </field>
1992                 <field>
1993                     <name>record_id</name>
1994                     <type>text</type>
1995                     <length>40</length>
1996                     <notnull>true</notnull>
1997                 </field>
1998                 <field>
1999                     <name>customfield_id</name>
2000                     <type>text</type>
2001                     <length>40</length>
2002                     <notnull>true</notnull>
2003                 </field>
2004                 <field>
2005                     <name>value</name>
2006                     <type>text</type>
2007                 </field>
2008                 <index>
2009                     <name>id</name>
2010                     <primary>true</primary>
2011                     <field>
2012                         <name>id</name>
2013                     </field>
2014                 </index>
2015                 <index>
2016                     <name>record_id_customfield_id</name>
2017                     <unique>true</unique>
2018                     <field>
2019                         <name>record_id</name>
2020                     </field>
2021                     <field>
2022                         <name>customfield_id</name>
2023                     </field>
2024                 </index>
2025                 <index>
2026                     <name>customfield_id</name>
2027                     <field>
2028                         <name>customfield_id</name>
2029                     </field>
2030                 </index>
2031             </declaration>
2032         </table>
2033         <table>
2034             <name>customfield_config</name>
2035             <version>5</version>
2036             <declaration>
2037                 <field>
2038                     <name>id</name>
2039                     <type>text</type>
2040                     <length>40</length>
2041                     <notnull>true</notnull>
2042                 </field>
2043                 <field>
2044                     <name>application_id</name>
2045                     <type>text</type>
2046                     <length>40</length>
2047                     <notnull>true</notnull>
2048                 </field>
2049                 <field>
2050                     <name>model</name>
2051                     <type>text</type>
2052                     <length>40</length>
2053                     <notnull>true</notnull>
2054                 </field>
2055                 <field>
2056                     <name>name</name>
2057                     <type>text</type>
2058                     <length>40</length>
2059                     <notnull>true</notnull>
2060                 </field>
2061                 <field>
2062                     <name>definition</name>
2063                     <type>text</type>
2064                 </field>
2065                 <index>
2066                     <name>id</name>
2067                     <primary>true</primary>
2068                     <field>
2069                         <name>id</name>
2070                     </field>
2071                 </index>
2072                 <index>
2073                     <name>application_id-name</name>
2074                     <unique>true</unique>
2075                     <field>
2076                         <name>application_id</name>
2077                     </field>
2078                     <field>
2079                         <name>name</name>
2080                     </field>
2081                 </index>
2082                 <index>
2083                     <name>config_customfields::application_id--applications::id</name>
2084                     <field>
2085                         <name>application_id</name>
2086                     </field>
2087                     <foreign>true</foreign>
2088                     <reference>
2089                         <table>applications</table>
2090                         <field>id</field>
2091                         <!-- add onupdate/ondelete? -->
2092                     </reference>
2093                 </index>
2094             </declaration>
2095         </table>
2096         <table>
2097             <name>customfield_acl</name>
2098             <version>2</version>
2099             <declaration>
2100                 <field>
2101                     <name>id</name>
2102                     <type>text</type>
2103                     <length>40</length>
2104                     <notnull>true</notnull>
2105                 </field>
2106                 <field>
2107                     <name>customfield_id</name>
2108                     <type>text</type>
2109                     <length>40</length>
2110                     <notnull>true</notnull>
2111                 </field>
2112                 <field>
2113                     <name>account_type</name>
2114                     <type>text</type>
2115                     <length>32</length>
2116                     <default>user</default>
2117                     <notnull>true</notnull>
2118                 </field>
2119                 <field>
2120                     <name>account_id</name>
2121                     <type>text</type>
2122                     <length>40</length>
2123                     <notnull>true</notnull>
2124                 </field>
2125                 <field>
2126                     <name>account_grant</name>
2127                     <type>text</type>
2128                     <length>40</length>
2129                     <notnull>true</notnull>
2130                 </field>
2131                 <index>
2132                     <name>customfield_id-account-type-account_id-account_grant</name>
2133                     <primary>true</primary>
2134                     <field>
2135                         <name>id</name>
2136                     </field>
2137                     <field>
2138                         <name>customfield_id</name>
2139                     </field>
2140                     <field>
2141                         <name>account_type</name>
2142                     </field>
2143                     <field>
2144                         <name>account_id</name>
2145                     </field>
2146                     <field>
2147                         <name>account_grant</name>
2148                     </field>
2149                 </index>
2150                 <index>
2151                     <name>id-account_type-account_id</name>
2152                     <field>
2153                         <name>customfield_id</name>
2154                     </field>
2155                     <field>
2156                         <name>account_type</name>
2157                     </field>
2158                     <field>
2159                         <name>account_id</name>
2160                     </field>
2161                 </index>
2162                 <index>
2163                     <name>customfield_acl::customfield_id--customfield_config::id</name>
2164                     <field>
2165                         <name>customfield_id</name>
2166                     </field>
2167                     <foreign>true</foreign>
2168                     <reference>
2169                         <table>customfield_config</table>
2170                         <field>id</field>
2171                         <ondelete>cascade</ondelete>
2172                         <!-- add onupdate? -->
2173                     </reference>
2174                 </index>
2175             </declaration>
2176         </table>
2177         <table>
2178             <name>note_types</name>
2179             <version>3</version>
2180             <declaration>
2181                 <field>
2182                     <name>id</name>
2183                     <type>text</type>
2184                     <length>40</length>
2185                     <notnull>true</notnull>
2186                 </field>
2187                 <field>
2188                     <name>name</name>
2189                     <type>text</type>
2190                     <length>64</length>
2191                     <notnull>true</notnull>
2192                 </field>
2193                 <field>
2194                     <name>description</name>
2195                     <type>text</type>
2196                     <length>255</length>
2197                     <default>NULL</default>
2198                 </field>
2199                 <field>
2200                     <name>icon</name>
2201                     <type>text</type>
2202                     <length>255</length>
2203                     <notnull>true</notnull>
2204                 </field>
2205                 <field>
2206                     <name>icon_class</name>
2207                     <type>text</type>
2208                     <length>128</length>
2209                     <default>NULL</default>
2210                 </field>
2211                 <field>
2212                     <name>is_user_type</name>
2213                     <type>boolean</type>
2214                     <notnull>true</notnull>
2215                     <default>true</default>
2216                 </field>
2217                 <index>
2218                     <name>id</name>
2219                     <primary>true</primary>
2220                     <field>
2221                         <name>id</name>
2222                     </field>
2223                 </index>
2224             </declaration>
2225         </table>
2226         <table>
2227             <name>notes</name>
2228             <version>2</version>
2229             <declaration>
2230                 <field>
2231                     <name>id</name>
2232                     <type>text</type>
2233                     <length>40</length>
2234                     <notnull>true</notnull>
2235                 </field>
2236                 <field>
2237                     <name>note_type_id</name>
2238                     <type>text</type>
2239                     <length>40</length>
2240                     <notnull>true</notnull>
2241                 </field>
2242                 <field>
2243                     <name>note</name>
2244                     <type>text</type>
2245                     <default>NULL</default>
2246                 </field>
2247                 <field>
2248                     <name>record_model</name>
2249                     <type>text</type>
2250                     <length>40</length>
2251                     <notnull>true</notnull>
2252                 </field>
2253                 <field>
2254                     <name>record_backend</name>
2255                     <type>text</type>
2256                     <length>40</length>
2257                     <notnull>true</notnull>
2258                 </field>
2259                 <field>
2260                     <name>record_id</name>
2261                     <type>text</type>
2262                     <length>40</length>
2263                     <notnull>true</notnull>
2264                 </field>
2265                 <field>
2266                     <name>created_by</name>
2267                     <type>text</type>
2268                     <length>40</length>
2269                 </field>
2270                 <field>
2271                     <name>creation_time</name>
2272                     <type>datetime</type>
2273                 </field>
2274                 <field>
2275                     <name>last_modified_by</name>
2276                     <type>text</type>
2277                     <length>40</length>
2278                 </field>
2279                 <field>
2280                     <name>last_modified_time</name>
2281                     <type>datetime</type>
2282                 </field>
2283                 <field>
2284                     <name>is_deleted</name>
2285                     <type>boolean</type>
2286                     <notnull>true</notnull>
2287                     <default>false</default>
2288                 </field>
2289                 <field>
2290                     <name>deleted_by</name>
2291                     <type>text</type>
2292                     <length>40</length>
2293                 </field>
2294                 <field>
2295                     <name>deleted_time</name>
2296                     <type>datetime</type>
2297                 </field>
2298                 <field>
2299                     <name>seq</name>
2300                     <type>integer</type>
2301                     <notnull>true</notnull>
2302                     <default>0</default>
2303                 </field>
2304                 <index>
2305                     <name>id</name>
2306                     <primary>true</primary>
2307                     <field>
2308                         <name>id</name>
2309                     </field>
2310                 </index>
2311                 <index>
2312                     <name>record_id</name>
2313                     <field>
2314                         <name>record_id</name>
2315                     </field>
2316                 </index>
2317                 <index>
2318                     <name>record_model</name>
2319                     <field>
2320                         <name>record_model</name>
2321                     </field>
2322                 </index>
2323                 <index>
2324                     <name>record_backend</name>
2325                     <field>
2326                         <name>record_backend</name>
2327                     </field>
2328                 </index>
2329                 <index>
2330                     <name>notes::note_type_id--note_types::id</name>
2331                     <field>
2332                         <name>note_type_id</name>
2333                     </field>
2334                     <foreign>true</foreign>
2335                     <reference>
2336                         <table>note_types</table>
2337                         <field>id</field>
2338                         <!-- add onupdate/ondelete? -->
2339                     </reference>
2340                 </index>
2341             </declaration>
2342         </table>
2343         <table>
2344             <name>filter</name>
2345             <version>5</version>
2346             <declaration>
2347                 <field>
2348                     <name>id</name>
2349                     <type>text</type>
2350                     <length>40</length>
2351                     <notnull>true</notnull>
2352                 </field>
2353                 <field>
2354                     <name>application_id</name>
2355                     <type>text</type>
2356                     <length>40</length>
2357                     <notnull>true</notnull>
2358                 </field>
2359                 <field>
2360                     <name>account_id</name>
2361                     <type>text</type>
2362                     <length>40</length>
2363                     <notnull>false</notnull>
2364                 </field>
2365                 <field>
2366                     <name>model</name>
2367                     <type>text</type>
2368                     <length>64</length>
2369                     <notnull>true</notnull>
2370                 </field>
2371                 <field>
2372                     <name>filters</name>
2373                     <type>text</type>
2374                     <notnull>true</notnull>
2375                 </field>
2376                 <field>
2377                     <name>name</name>
2378                     <type>text</type>
2379                     <length>40</length>
2380                     <notnull>true</notnull>
2381                 </field>
2382                 <field>
2383                     <name>description</name>
2384                     <type>text</type>
2385                     <notnull>false</notnull>
2386                 </field>
2387                 <field>
2388                     <name>created_by</name>
2389                     <type>text</type>
2390                     <length>40</length>
2391                 </field>
2392                 <field>
2393                     <name>creation_time</name>
2394                     <type>datetime</type>
2395                 </field>
2396                 <field>
2397                     <name>last_modified_by</name>
2398                     <type>text</type>
2399                     <length>40</length>
2400                 </field>
2401                 <field>
2402                     <name>last_modified_time</name>
2403                     <type>datetime</type>
2404                 </field>
2405                 <field>
2406                     <name>is_deleted</name>
2407                     <type>boolean</type>
2408                     <default>false</default>
2409                 </field>
2410                 <field>
2411                     <name>deleted_by</name>
2412                     <type>text</type>
2413                     <length>40</length>
2414                 </field>
2415                 <field>
2416                     <name>deleted_time</name>
2417                     <type>datetime</type>
2418                 </field>
2419                 <field>
2420                     <name>seq</name>
2421                     <type>integer</type>
2422                     <notnull>true</notnull>
2423                     <default>0</default>
2424                 </field>
2425                 <index>
2426                     <name>id</name>
2427                     <primary>true</primary>
2428                     <field>
2429                         <name>id</name>
2430                     </field>
2431                 </index>
2432                 <index>
2433                     <name>filter::application_id--applications::id</name>
2434                     <field>
2435                         <name>application_id</name>
2436                     </field>
2437                     <foreign>true</foreign>
2438                     <reference>
2439                         <table>applications</table>
2440                         <field>id</field>
2441                     </reference>
2442                 </index>
2443             </declaration>
2444         </table>
2445         <table>
2446             <name>filter_acl</name>
2447             <version>1</version>
2448             <declaration>
2449                 <field>
2450                     <name>id</name>
2451                     <type>text</type>
2452                     <length>40</length>
2453                     <notnull>true</notnull>
2454                 </field>
2455                 <field>
2456                     <name>record_id</name>
2457                     <type>text</type>
2458                     <length>40</length>
2459                     <notnull>true</notnull>
2460                 </field>
2461                 <field>
2462                     <name>account_type</name>
2463                     <type>text</type>
2464                     <length>32</length>
2465                     <default>user</default>
2466                     <notnull>true</notnull>
2467                 </field>
2468                 <field>
2469                     <name>account_id</name>
2470                     <type>text</type>
2471                     <length>40</length>
2472                     <notnull>true</notnull>
2473                 </field>
2474                 <field>
2475                     <name>account_grant</name>
2476                     <type>text</type>
2477                     <length>40</length>
2478                     <notnull>true</notnull>
2479                 </field>
2480                 <index>
2481                     <name>record_id-account-type-account_id-account_grant</name>
2482                     <primary>true</primary>
2483                     <field>
2484                         <name>id</name>
2485                     </field>
2486                     <field>
2487                         <name>record_id</name>
2488                     </field>
2489                     <field>
2490                         <name>account_type</name>
2491                     </field>
2492                     <field>
2493                         <name>account_id</name>
2494                     </field>
2495                     <field>
2496                         <name>account_grant</name>
2497                     </field>
2498                 </index>
2499                 <index>
2500                     <name>id-account_type-account_id</name>
2501                     <field>
2502                         <name>record_id</name>
2503                     </field>
2504                     <field>
2505                         <name>account_type</name>
2506                     </field>
2507                     <field>
2508                         <name>account_id</name>
2509                     </field>
2510                 </index>
2511                 <index>
2512                     <name>filter_acl::record_id--filter::id</name>
2513                     <field>
2514                         <name>record_id</name>
2515                     </field>
2516                     <foreign>true</foreign>
2517                     <reference>
2518                         <table>filter</table>
2519                         <field>id</field>
2520                         <ondelete>cascade</ondelete>
2521                     </reference>
2522                 </index>
2523             </declaration>
2524         </table>
2525         <table>
2526             <name>importexport_definition</name>
2527             <version>8</version>
2528             <declaration>
2529                 <field>
2530                     <name>id</name>
2531                     <type>text</type>
2532                     <length>40</length>
2533                     <notnull>true</notnull>
2534                 </field>
2535                 <field>
2536                     <name>application_id</name>
2537                     <type>text</type>
2538                     <length>40</length>
2539                     <notnull>true</notnull>
2540                 </field>
2541                 <field>
2542                     <name>label</name>
2543                     <type>text</type>
2544                     <length>128</length>
2545                     <notnull>false</notnull>
2546                 </field>
2547                 <field>
2548                     <name>model</name>
2549                     <type>text</type>
2550                     <length>64</length>
2551                     <notnull>true</notnull>
2552                 </field>
2553                 <field>
2554                     <name>name</name>
2555                     <type>text</type>
2556                     <length>40</length>
2557                     <notnull>true</notnull>
2558                 </field>
2559                 <field>
2560                     <name>description</name>
2561                     <type>text</type>
2562                     <notnull>false</notnull>
2563                 </field>
2564                 <field>
2565                     <name>type</name>
2566                     <type>text</type>
2567                     <length>32</length>
2568                     <notnull>true</notnull>
2569                 </field>
2570                 <field>
2571                     <name>plugin</name>
2572                     <type>text</type>
2573                     <length>64</length>
2574                     <notnull>true</notnull>
2575                 </field>
2576                 <field>
2577                     <name>plugin_options</name>
2578                     <type>text</type>
2579                 </field>
2580                 <field>
2581                     <name>filename</name>
2582                     <type>text</type>
2583                     <length>40</length>
2584                 </field>
2585                 <field>
2586                     <name>created_by</name>
2587                     <type>text</type>
2588                     <length>40</length>
2589                 </field>
2590                 <field>
2591                     <name>creation_time</name>
2592                     <type>datetime</type>
2593                 </field>
2594                 <field>
2595                     <name>last_modified_by</name>
2596                     <type>text</type>
2597                     <length>40</length>
2598                 </field>
2599                 <field>
2600                     <name>last_modified_time</name>
2601                     <type>datetime</type>
2602                 </field>
2603                 <field>
2604                     <name>is_deleted</name>
2605                     <type>boolean</type>
2606                     <default>false</default>
2607                 </field>
2608                 <field>
2609                     <name>deleted_by</name>
2610                     <type>text</type>
2611                     <length>40</length>
2612                 </field>
2613                 <field>
2614                     <name>deleted_time</name>
2615                     <type>datetime</type>
2616                 </field>
2617                 <field>
2618                     <name>seq</name>
2619                     <type>integer</type>
2620                     <notnull>true</notnull>
2621                     <default>0</default>
2622                 </field>
2623                 <index>
2624                     <name>id</name>
2625                     <primary>true</primary>
2626                     <field>
2627                         <name>id</name>
2628                     </field>
2629                 </index>
2630                 <index>
2631                     <name>model-name-type</name>
2632                     <unique>true</unique>
2633                     <field>
2634                         <name>model</name>
2635                     </field>
2636                     <field>
2637                         <name>name</name>
2638                     </field>
2639                     <field>
2640                         <name>type</name>
2641                     </field>
2642                 </index>
2643                 <index>
2644                     <name>importexport_definitions::app_id--applications::id</name>
2645                     <field>
2646                         <name>application_id</name>
2647                     </field>
2648                     <foreign>true</foreign>
2649                     <reference>
2650                         <table>applications</table>
2651                         <field>id</field>
2652                         <!-- add onupdate/ondelete? -->
2653                     </reference>
2654                 </index>
2655             </declaration>
2656         </table>
2657         <table>
2658             <name>alarm</name>
2659             <version>3</version>
2660             <declaration>
2661                 <field>
2662                     <name>id</name>
2663                     <type>text</type>
2664                     <length>40</length>
2665                     <notnull>true</notnull>
2666                 </field>
2667                 <field>
2668                     <name>record_id</name>
2669                     <type>text</type>
2670                     <length>40</length>
2671                     <notnull>true</notnull>
2672                 </field>
2673                 <field>
2674                     <name>model</name>
2675                     <type>text</type>
2676                     <length>40</length>
2677                     <notnull>true</notnull>
2678                 </field>
2679                 <field>
2680                     <name>alarm_time</name>
2681                     <type>datetime</type>
2682                 </field>
2683                 <field>
2684                     <name>sent_time</name>
2685                     <type>datetime</type>
2686                 </field>
2687                 <field>
2688                     <name>sent_status</name>
2689                     <type>text</type>
2690                     <length>32</length>
2691                     <default>pending</default>
2692                     <notnull>true</notnull>
2693                 </field>
2694                 <field>
2695                     <name>sent_message</name>
2696                     <type>text</type>
2697                 </field>
2698                 <field>
2699                     <name>options</name>
2700                     <type>text</type>
2701                 </field>
2702                 <index>
2703                     <name>id</name>
2704                     <primary>true</primary>
2705                     <field>
2706                         <name>id</name>
2707                     </field>
2708                 </index>
2709                 <index>
2710                     <name>record_id-model</name>
2711                     <field>
2712                         <name>record_id</name>
2713                     </field>
2714                     <field>
2715                         <name>model</name>
2716                     </field>
2717                 </index>
2718             </declaration>
2719         </table>
2720         <table>
2721             <name>import</name>
2722             <version>1</version>
2723             <declaration>
2724                 <field>
2725                     <name>id</name>
2726                     <type>text</type>
2727                     <length>80</length>
2728                     <notnull>true</notnull>
2729                 </field>
2730                 <field>
2731                     <name>timestamp</name>
2732                     <type>datetime</type>
2733                 </field>
2734                 <field>
2735                     <name>user_id</name>
2736                     <type>text</type>
2737                     <length>80</length>
2738                     <notnull>true</notnull>
2739                 </field>
2740                 <field>
2741                     <name>model</name>
2742                     <type>text</type>
2743                     <length>80</length>
2744                     <notnull>true</notnull>
2745                 </field>
2746                 <field>
2747                     <name>application_id</name>
2748                     <type>text</type>
2749                     <length>80</length>
2750                     <notnull>true</notnull>
2751                 </field>
2752                 <field>
2753                     <name>synctoken</name>
2754                     <type>text</type>
2755                     <length>80</length>
2756                 </field>
2757                 <field>
2758                     <name>container_id</name>
2759                     <length>80</length>
2760                     <type>text</type>
2761                 </field>
2762                 <field>
2763                     <name>sourcetype</name>
2764                     <type>text</type>
2765                     <notnull>true</notnull>
2766                 </field>
2767                 <field>
2768                     <name>interval</name>
2769                     <type>text</type>
2770                 </field>
2771                 <field>
2772                     <name>source</name>
2773                     <type>text</type>
2774                 </field>
2775                 <field>
2776                     <name>options</name>
2777                     <type>text</type>
2778                 </field>
2779                 <index>
2780                     <name>id</name>
2781                     <primary>true</primary>
2782                     <field>
2783                         <name>id</name>
2784                     </field>
2785                 </index>
2786                 <field>
2787                     <name>created_by</name>
2788                     <type>text</type>
2789                     <length>40</length>
2790                 </field>
2791                 <field>
2792                     <name>creation_time</name>
2793                     <type>datetime</type>
2794                 </field>
2795                 <field>
2796                     <name>last_modified_by</name>
2797                     <type>text</type>
2798                     <length>40</length>
2799                 </field>
2800                 <field>
2801                     <name>last_modified_time</name>
2802                     <type>datetime</type>
2803                 </field>
2804                 <field>
2805                     <name>is_deleted</name>
2806                     <type>boolean</type>
2807                     <notnull>true</notnull>
2808                     <default>false</default>
2809                 </field>
2810                 <field>
2811                     <name>deleted_by</name>
2812                     <type>text</type>
2813                     <length>40</length>
2814                 </field>
2815                 <field>
2816                     <name>deleted_time</name>
2817                     <type>datetime</type>
2818                 </field>
2819                 <field>
2820                     <name>seq</name>
2821                     <type>integer</type>
2822                     <notnull>true</notnull>
2823                     <default>0</default>
2824                 </field>
2825                 <index>
2826                     <name>import::application_id--applications::id</name>
2827                     <field>
2828                         <name>application_id</name>
2829                     </field>
2830                     <foreign>true</foreign>
2831                     <reference>
2832                         <table>applications</table>
2833                         <field>id</field>
2834                     </reference>
2835                 </index>
2836                 <index>
2837                     <name>import::user_id--accounts::id</name>
2838                     <field>
2839                         <name>user_id</name>
2840                     </field>
2841                     <foreign>true</foreign>
2842                     <reference>
2843                         <table>accounts</table>
2844                         <field>id</field>
2845                     </reference>
2846                 </index>
2847             </declaration>
2848         </table>
2849         <table>
2850             <name>async_job</name>
2851             <version>3</version>
2852             <declaration>
2853                 <field>
2854                     <name>id</name>
2855                     <type>text</type>
2856                     <length>40</length>
2857                     <notnull>true</notnull>
2858                 </field>
2859                 <field>
2860                     <name>name</name>
2861                     <type>text</type>
2862                     <length>64</length>
2863                 </field>
2864                 <field>
2865                     <name>start_time</name>
2866                     <type>datetime</type>
2867                 </field>
2868                 <field>
2869                     <name>end_time</name>
2870                     <type>datetime</type>
2871                 </field>
2872                 <field>
2873                     <name>status</name>
2874                     <type>text</type>
2875                     <length>32</length>
2876                 </field>
2877                 <field>
2878                     <name>seq</name>
2879                     <type>integer</type>
2880                     <length>64</length>
2881                 </field>
2882                 <field>
2883                     <name>message</name>
2884                     <type>text</type>
2885                 </field>
2886                 <index>
2887                     <name>id</name>
2888                     <primary>true</primary>
2889                     <field>
2890                         <name>id</name>
2891                     </field>
2892                 </index>
2893                 <index>
2894                     <name>name-seq</name>
2895                     <unique>true</unique>
2896                     <field>
2897                         <name>name</name>
2898                     </field>
2899                     <field>
2900                         <name>seq</name>
2901                     </field>
2902                 </index>
2903             </declaration>
2904         </table>
2905         <table>
2906             <name>state</name>
2907             <version>3</version>
2908             <declaration>
2909                 <field>
2910                     <name>id</name>
2911                     <type>text</type>
2912                     <length>40</length>
2913                     <notnull>true</notnull>
2914                 </field>
2915                 <field>
2916                     <name>state_id</name>
2917                     <type>text</type>
2918                     <length>128</length>
2919                     <notnull>true</notnull>
2920                 </field>
2921                 <field>
2922                     <name>user_id</name>
2923                     <type>text</type>
2924                     <length>40</length>
2925                     <notnull>true</notnull>
2926                 </field>
2927                 <field>
2928                     <name>data</name>
2929                     <type>clob</type>
2930                 </field>
2931                 <index>
2932                     <name>id</name>
2933                     <primary>true</primary>
2934                     <field>
2935                         <name>id</name>
2936                     </field>
2937                 </index>
2938                 <index>
2939                     <name>user_id--state_id</name>
2940                     <unique>true</unique>
2941                     <field>
2942                         <name>user_id</name>
2943                     </field>
2944                     <field>
2945                         <name>state_id</name>
2946                     </field>
2947                 </index>
2948             </declaration>
2949         </table>
2950         <table>
2951             <name>openid_assoc</name>
2952             <version>1</version>
2953             <declaration>
2954                 <field>
2955                     <name>id</name>
2956                     <type>text</type>
2957                     <length>40</length>
2958                     <notnull>true</notnull>
2959                 </field>
2960                 <field>
2961                     <name>macfunc</name>
2962                     <type>text</type>
2963                     <length>40</length>
2964                     <notnull>true</notnull>
2965                 </field>
2966                 <field>
2967                     <name>secret</name>
2968                     <type>text</type>
2969                     <length>254</length>
2970                     <notnull>true</notnull>
2971                 </field>
2972                 <field>
2973                     <name>expires</name>
2974                     <type>integer</type>
2975                     <notnull>true</notnull>
2976                 </field>
2977                 <index>
2978                     <name>id</name>
2979                     <primary>true</primary>
2980                     <field>
2981                         <name>id</name>
2982                     </field>
2983                 </index>
2984             </declaration>
2985         </table>
2986         <table>
2987             <name>openid_sites</name>
2988             <version>1</version>
2989             <declaration>
2990                 <field>
2991                     <name>id</name>
2992                     <type>text</type>
2993                     <length>40</length>
2994                     <notnull>true</notnull>
2995                 </field>
2996                 <field>
2997                     <name>account_id</name>
2998                     <type>text</type>
2999                     <length>40</length>
3000                     <notnull>true</notnull>
3001                 </field>
3002                 <field>
3003                     <name>site</name>
3004                     <type>text</type>
3005                     <length>254</length>
3006                     <notnull>true</notnull>
3007                 </field>
3008                 <field>
3009                     <name>trusted</name>
3010                     <type>text</type>
3011                 </field>
3012                 <index>
3013                     <name>id</name>
3014                     <primary>true</primary>
3015                     <field>
3016                         <name>id</name>
3017                     </field>
3018                 </index>
3019                 <index>
3020                     <name>account_id-site</name>
3021                     <unique>true</unique>
3022                     <length>40</length>
3023                     <field>
3024                         <name>account_id</name>
3025                     </field>
3026                     <field>
3027                         <name>site</name>
3028                     </field>
3029                 </index>
3030                 <index>
3031                     <name>openid_sites::account_id--accounts::id</name>
3032                     <field>
3033                         <name>account_id</name>
3034                     </field>
3035                     <foreign>true</foreign>
3036                     <reference>
3037                         <table>accounts</table>
3038                         <field>id</field>
3039                         <!-- add onupdate/ondelete? -->
3040                     </reference>
3041                 </index>
3042             </declaration>
3043         </table>
3044         <table>
3045             <name>scheduler</name>
3046             <version>1</version>
3047             <declaration>
3048                 <field>
3049                     <name>id</name>
3050                     <type>integer</type>
3051                     <length>11</length>
3052                     <autoincrement>true</autoincrement>
3053                     <notnull>true</notnull>
3054                 </field>
3055                 <field>
3056                     <name>name</name>
3057                     <type>text</type>
3058                     <length>255</length>
3059                     <notnull>true</notnull>
3060                 </field>
3061                 <field>
3062                     <name>data</name>
3063                     <type>text</type>
3064                     <notnull>true</notnull>
3065                 </field>
3066                 <index>
3067                     <name>id</name>
3068                     <primary>true</primary>
3069                     <field>
3070                         <name>id</name>
3071                     </field>
3072                 </index>
3073             </declaration>
3074         </table>
3075         
3076         <table>
3077             <name>departments</name>
3078             <version>2</version>
3079             <declaration>
3080                 <field>
3081                     <name>id</name>
3082                     <type>text</type>
3083                     <length>40</length>
3084                     <notnull>true</notnull>
3085                 </field>
3086                 <field>
3087                     <name>name</name>
3088                     <type>text</type>
3089                     <length>128</length>
3090                     <notnull>true</notnull>
3091                 </field>
3092                 <field>
3093                     <name>description</name>
3094                     <type>text</type>
3095                     <length>254</length>
3096                     <notnull>false</notnull>
3097                 </field>
3098                 <field>
3099                     <name>created_by</name>
3100                     <type>text</type>
3101                     <length>40</length>
3102                 </field>
3103                 <field>
3104                     <name>creation_time</name>
3105                     <type>datetime</type>
3106                 </field>
3107                 <field>
3108                     <name>last_modified_by</name>
3109                     <type>text</type>
3110                     <length>40</length>
3111                 </field>
3112                 <field>
3113                     <name>last_modified_time</name>
3114                     <type>datetime</type>
3115                 </field>
3116                 <field>
3117                     <name>is_deleted</name>
3118                     <type>boolean</type>
3119                     <default>false</default>
3120                 </field>
3121                 <field>
3122                     <name>deleted_by</name>
3123                     <type>text</type>
3124                     <length>40</length>
3125                 </field>
3126                 <field>
3127                     <name>deleted_time</name>
3128                     <type>datetime</type>
3129                 </field>
3130                 <field>
3131                     <name>seq</name>
3132                     <type>integer</type>
3133                     <notnull>true</notnull>
3134                     <default>0</default>
3135                 </field>
3136                 <index>
3137                     <name>id</name>
3138                     <primary>true</primary>
3139                     <field>
3140                         <name>id</name>
3141                     </field>
3142                 </index>
3143                 <index>
3144                     <name>name</name>
3145                     <unique>true</unique>
3146                     <length>40</length>
3147                     <field>
3148                         <name>name</name>
3149                     </field>
3150                 </index>
3151             </declaration>
3152         </table>
3153         
3154         <table>
3155             <name>tree_fileobjects</name>
3156             <version>2</version>
3157             <declaration>
3158                 <field>
3159                     <name>id</name>
3160                     <type>text</type>
3161                     <length>40</length>
3162                     <notnull>true</notnull>
3163                 </field>
3164                 <field>
3165                     <name>revision</name>
3166                     <type>integer</type>
3167                     <length>64</length>
3168                     <default>0</default>
3169                 </field>
3170                 <field>
3171                     <name>type</name>
3172                     <type>text</type>
3173                     <length>64</length>
3174                     <notnull>true</notnull>
3175                 </field>
3176                 <field>
3177                     <name>contenttype</name>
3178                     <type>text</type>
3179                     <length>128</length>
3180                 </field>
3181                 <field>
3182                     <name>created_by</name>
3183                     <type>text</type>
3184                     <length>40</length>
3185                 </field>
3186                 <field>
3187                     <name>description</name>
3188                     <type>text</type>
3189                     <length>255</length>
3190                     <notnull>false</notnull>
3191                 </field>
3192                 <field>
3193                     <name>creation_time</name>
3194                     <type>datetime</type>
3195                 </field> 
3196                 <field>
3197                     <name>last_modified_by</name>
3198                     <type>text</type>
3199                     <length>40</length>
3200                 </field>
3201                 <field>
3202                     <name>last_modified_time</name>
3203                     <type>datetime</type>
3204                 </field>
3205                 <field>
3206                     <name>is_deleted</name>
3207                     <type>boolean</type>
3208                     <default>false</default>
3209                 </field>
3210                 <field>
3211                     <name>deleted_by</name>
3212                     <type>text</type>
3213                     <length>40</length>
3214                 </field>
3215                 <field>
3216                     <name>deleted_time</name>
3217                     <type>datetime</type>
3218                 </field>
3219                 <field>
3220                     <name>seq</name>
3221                     <type>integer</type>
3222                     <notnull>true</notnull>
3223                     <default>0</default>
3224                 </field>
3225                 <index>
3226                     <name>id</name>
3227                     <primary>true</primary>
3228                     <field>
3229                         <name>id</name>
3230                     </field>
3231                 </index>
3232                 <index>
3233                     <name>type</name>
3234                     <field>
3235                         <name>type</name>
3236                     </field>
3237                 </index>
3238                 <index>
3239                     <name>is_deleted</name>
3240                     <field>
3241                         <name>is_deleted</name>
3242                     </field>
3243                 </index>
3244             </declaration>
3245         </table>
3246
3247         <table>
3248             <name>tree_filerevisions</name>
3249             <version>1</version>
3250             <declaration>
3251                 <field>
3252                     <name>id</name>
3253                     <type>text</type>
3254                     <length>40</length>
3255                     <notnull>true</notnull>
3256                 </field>
3257                 <field>
3258                     <name>revision</name>
3259                     <type>integer</type>
3260                     <length>64</length>
3261                     <notnull>true</notnull>
3262                 </field>
3263                 <field>
3264                     <name>hash</name>
3265                     <type>text</type>
3266                     <length>40</length>
3267                     <notnull>true</notnull>
3268                 </field>
3269                 <field>
3270                     <name>size</name>
3271                     <type>integer</type>
3272                     <length>64</length>
3273                     <notnull>true</notnull>
3274                 </field>
3275                 <field>
3276                     <name>created_by</name>
3277                     <type>text</type>
3278                     <length>40</length>
3279                 </field>
3280                 <field>
3281                     <name>creation_time</name>
3282                     <type>datetime</type>
3283                 </field> 
3284                 <index>
3285                     <name>id-revision</name>
3286                     <primary>true</primary>
3287                     <field>
3288                         <name>id</name>
3289                     </field>
3290                     <field>
3291                         <name>revision</name>
3292                     </field>
3293                 </index>
3294                 <index>
3295                     <name>revision</name>
3296                     <field>
3297                         <name>revision</name>
3298                     </field>
3299                 </index>
3300                 <index>
3301                     <name>tree_filerevisions::id--tree_fileobjects::id</name>
3302                     <field>
3303                         <name>id</name>
3304                     </field>
3305                     <foreign>true</foreign>
3306                     <reference>
3307                         <table>tree_fileobjects</table>
3308                         <field>id</field>
3309                         <onupdate>cascade</onupdate>
3310                         <ondelete>cascade</ondelete>
3311                     </reference>
3312                 </index>
3313                 <index>
3314                     <name>tree_filerevisions::created_by--accounts::id</name>
3315                     <field>
3316                         <name>created_by</name>
3317                     </field>
3318                     <foreign>true</foreign>
3319                     <reference>
3320                         <table>accounts</table>
3321                         <field>id</field>
3322                         <onupdate>CASCADE</onupdate>
3323                         <ondelete>SET NULL</ondelete>
3324                     </reference>
3325                 </index>
3326             </declaration>
3327         </table>
3328
3329         <table>
3330             <name>tree_nodes</name>
3331             <version>1</version>
3332             <declaration>
3333                 <field>
3334                     <name>id</name>
3335                     <type>text</type>
3336                     <length>40</length>
3337                     <notnull>true</notnull>
3338                 </field>
3339                 <field>
3340                     <name>parent_id</name>
3341                     <type>text</type>
3342                     <length>40</length>
3343                 </field>
3344                 <field>
3345                     <name>object_id</name>
3346                     <type>text</type>
3347                     <length>40</length>
3348                     <notnull>true</notnull>
3349                 </field>
3350                 <field>
3351                     <name>name</name>
3352                     <type>text</type>
3353                     <length>255</length>
3354                     <notnull>true</notnull>
3355                 </field>
3356                 <field>
3357                     <name>islink</name>
3358                     <type>boolean</type>
3359                     <default>false</default>
3360                     <notnull>true</notnull>
3361                 </field>
3362                 <index>
3363                     <name>id</name>
3364                     <primary>true</primary>
3365                     <field>
3366                         <name>id</name>
3367                     </field>
3368                 </index>
3369                 <index>
3370                     <name>parent_id-name</name>
3371                     <unique>true</unique>
3372                     <field>
3373                         <name>parent_id</name>
3374                     </field>
3375                     <field>
3376                         <name>name</name>
3377                     </field>
3378                 </index>
3379                 <index>
3380                     <name>tree_nodes::object_id--tree_fileobjects::id</name>
3381                     <field>
3382                         <name>object_id</name>
3383                     </field>
3384                     <foreign>true</foreign>
3385                     <reference>
3386                         <table>tree_fileobjects</table>
3387                         <field>id</field>
3388                         <onupdate>cascade</onupdate>
3389                         <!-- add ondelete? -->
3390                     </reference>
3391                 </index>
3392                 <index>
3393                     <name>tree_nodes::parent_id--tree_nodes::id</name>
3394                     <field>
3395                         <name>parent_id</name>
3396                     </field>
3397                     <foreign>true</foreign>
3398                     <reference>
3399                         <table>tree_nodes</table>
3400                         <field>id</field>
3401                         <onupdate>cascade</onupdate>
3402                         <!-- add ondelete? -->
3403                     </reference>
3404                 </index>
3405             </declaration>
3406         </table>
3407     </tables>
3408
3409     <defaultRecords>
3410         <record>
3411             <table>
3412                 <name>note_types</name>
3413             </table>
3414             <field>
3415                 <name>id</name>
3416                 <value>1</value>
3417             </field>
3418             <field>
3419                 <name>name</name>
3420                 <value>note</value>
3421                 <!-- gettext('note') -->
3422             </field>
3423             <field>
3424                 <name>description</name>
3425                 <value>default note type</value>
3426                 <!-- gettext('default note type') -->
3427             </field>
3428             <field>
3429                 <name>icon</name>
3430                 <value>images/oxygen/16x16/actions/note.png</value>
3431             </field>
3432             <field>
3433                 <name>icon_class</name>
3434                 <value>notes_noteIcon</value>
3435             </field>
3436             <field>
3437                 <name>is_user_type</name>
3438                 <value>1</value>
3439             </field>
3440         </record>
3441         <record>
3442             <table>
3443                 <name>note_types</name>
3444             </table>
3445             <field>
3446                 <name>id</name>
3447                 <value>2</value>
3448             </field>
3449             <field>
3450                 <name>name</name>
3451                 <value>telephone</value>
3452                 <!-- gettext('telephone') -->
3453             </field>
3454             <field>
3455                 <name>description</name>
3456                 <value>telephone call</value>
3457                 <!-- gettext('telephone call') -->
3458             </field>
3459             <field>
3460                 <name>icon</name>
3461                 <value>images/oxygen/16x16/apps/kcall.png</value>
3462             </field>
3463