0011398: add own_id index to relations table
[tine20] / tine20 / Tinebase / Setup / setup.xml
1 <?xml version="1.0" encoding="utf-8"?>
2 <application>
3     <name>Tinebase</name>
4     <version>8.11</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>8</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>own_id</name>
1123                     <field>
1124                         <name>own_id</name>
1125                     </field>
1126                 </index>
1127                 <index>
1128                     <name>rel_id-own_model-own_backend-own_id</name>
1129                     <unique>true</unique>
1130                     <field>
1131                         <name>rel_id</name>
1132                     </field>
1133                     <field>
1134                         <name>own_model</name>
1135                     </field>
1136                     <field>
1137                         <name>own_backend</name>
1138                     </field>
1139                     <field>
1140                         <name>own_id</name>
1141                     </field>
1142                 </index>
1143                 <index>
1144                     <name>unique-fields</name>
1145                     <unique>true</unique>
1146                     <field>
1147                         <name>own_model</name>
1148                     </field>
1149                     <field>
1150                         <name>own_backend</name>
1151                     </field>
1152                     <field>
1153                         <name>own_id</name>
1154                     </field>
1155                     <field>
1156                         <name>related_model</name>
1157                     </field>
1158                     <field>
1159                         <name>related_backend</name>
1160                     </field>
1161                     <field>
1162                         <name>related_id</name>
1163                     </field>
1164                 </index>
1165             </declaration>
1166         </table>
1167
1168         <table>
1169             <name>timemachine_modlog</name>
1170             <version>3</version>
1171             <declaration>
1172                 <field>
1173                     <name>id</name>
1174                     <type>text</type>
1175                     <length>40</length>
1176                     <notnull>true</notnull>
1177                 </field>
1178                 <field>
1179                     <name>application_id</name>
1180                     <type>text</type>
1181                     <length>40</length>
1182                     <notnull>true</notnull>
1183                 </field>
1184                 <field>
1185                     <name>record_id</name>
1186                     <type>text</type>
1187                     <length>40</length>
1188                     <notnull>false</notnull>
1189                 </field>
1190                 <field>
1191                     <name>record_type</name>
1192                     <type>text</type>
1193                     <length>64</length>
1194                     <notnull>false</notnull>
1195                 </field>
1196                 <field>
1197                     <name>record_backend</name>
1198                     <type>text</type>
1199                     <length>64</length>
1200                     <notnull>false</notnull>
1201                 </field>
1202                 <field>
1203                     <name>modification_time</name>
1204                     <type>datetime</type>
1205                     <notnull>true</notnull>
1206                 </field>
1207                 <field>
1208                     <name>modification_account</name>
1209                     <type>text</type>
1210                     <length>40</length>
1211                     <notnull>true</notnull>
1212                 </field>
1213                 <field>
1214                     <name>modified_attribute</name>
1215                     <type>text</type>
1216                     <length>64</length>
1217                     <notnull>false</notnull>
1218                 </field>
1219                 <field>
1220                     <name>old_value</name>
1221                     <type>clob</type>
1222                 </field>
1223                 <field>
1224                     <name>new_value</name>
1225                     <type>clob</type>
1226                 </field>
1227                 <field>
1228                     <name>seq</name>
1229                     <type>integer</type>
1230                     <length>64</length>
1231                 </field>
1232                 <index>
1233                     <name>id</name>
1234                     <primary>true</primary>
1235                     <field>
1236                         <name>id</name>
1237                     </field>
1238                 </index>
1239                 <index>
1240                     <name>seq</name>
1241                     <field>
1242                         <name>seq</name>
1243                     </field>
1244                 </index>
1245                 <index>
1246                     <name>unique-fields</name>
1247                     <unique>true</unique>
1248                     <field>
1249                         <name>application_id</name>
1250                     </field>
1251                     <field>
1252                         <name>record_id</name>
1253                     </field>
1254                     <field>
1255                         <name>record_type</name>
1256                     </field>
1257                     <field>
1258                         <name>modification_time</name>
1259                     </field>
1260                     <field>
1261                         <name>modification_account</name>
1262                     </field>
1263                     <field>
1264                         <name>modified_attribute</name>
1265                     </field>
1266                     <field>
1267                         <name>seq</name>
1268                     </field>
1269                 </index>
1270             </declaration>
1271         </table>
1272
1273         <table>
1274             <name>tags</name>
1275             <version>7</version>
1276             <declaration>
1277                 <field>
1278                     <name>id</name>
1279                     <type>text</type>
1280                     <length>40</length>
1281                     <notnull>true</notnull>
1282                 </field>
1283                 <field>
1284                     <name>type</name>
1285                     <type>text</type>
1286                     <length>32</length>
1287                     <notnull>true</notnull>
1288                 </field>
1289                 <field>
1290                     <name>owner</name>
1291                     <type>text</type>
1292                     <length>40</length>
1293                 </field>
1294                 <field>
1295                     <name>name</name>
1296                     <type>text</type>
1297                     <length>255</length>
1298                     <default>NULL</default>
1299                 </field>
1300                 <field>
1301                     <name>description</name>
1302                     <type>text</type>
1303                     <length>255</length>
1304                     <default>NULL</default>
1305                 </field>
1306                 <field>
1307                     <name>color</name>
1308                     <type>text</type>
1309                     <length>7</length>
1310                     <default>NULL</default>
1311                 </field>
1312                 <field>
1313                     <name>occurrence</name>
1314                     <type>integer</type>
1315                 </field>
1316                 <field>
1317                     <name>created_by</name>
1318                     <type>text</type>
1319                     <length>40</length>
1320                 </field>
1321                 <field>
1322                     <name>creation_time</name>
1323                     <type>datetime</type>
1324                 </field>
1325                 <field>
1326                     <name>last_modified_by</name>
1327                     <type>text</type>
1328                     <length>40</length>
1329                 </field>
1330                 <field>
1331                     <name>last_modified_time</name>
1332                     <type>datetime</type>
1333                 </field>
1334                 <field>
1335                     <name>is_deleted</name>
1336                     <type>boolean</type>
1337                     <notnull>true</notnull>
1338                     <default>false</default>
1339                 </field>
1340                 <field>
1341                     <name>deleted_by</name>
1342                     <type>text</type>
1343                     <length>40</length>
1344                 </field>
1345                 <field>
1346                     <name>deleted_time</name>
1347                     <type>datetime</type>
1348                 </field>
1349                 <field>
1350                     <name>seq</name>
1351                     <type>integer</type>
1352                     <notnull>true</notnull>
1353                     <default>0</default>
1354                 </field>
1355                 <index>
1356                     <name>id</name>
1357                     <primary>true</primary>
1358                     <field>
1359                         <name>id</name>
1360                     </field>
1361                 </index>
1362                 <index>
1363                     <name>owner</name>
1364                     <field>
1365                         <name>owner</name>
1366                     </field>
1367                 </index>
1368                 <index>
1369                     <name>name</name>
1370                     <field>
1371                         <name>name</name>
1372                     </field>
1373                 </index>
1374             </declaration>
1375         </table>
1376
1377         <table>
1378             <name>tags_acl</name>
1379             <version>2</version>
1380             <declaration>
1381                 <field>
1382                     <name>tag_id</name>
1383                     <type>text</type>
1384                     <length>40</length>
1385                     <notnull>true</notnull>
1386                 </field>
1387                 <field>
1388                     <name>account_type</name>
1389                     <type>text</type>
1390                     <length>32</length>
1391                     <default>user</default>
1392                     <notnull>true</notnull>
1393                 </field>
1394                 <field>
1395                     <name>account_id</name>
1396                     <type>text</type>
1397                     <length>40</length>
1398                     <notnull>true</notnull>
1399                 </field>
1400                 <field>
1401                     <name>account_right</name>
1402                     <type>text</type>
1403                     <length>10</length>
1404                     <notnull>true</notnull>
1405                 </field>
1406                 <index>
1407                     <name>tag_id-account_type-account_id-account_right</name>
1408                     <primary>true</primary>
1409                     <field>
1410                         <name>tag_id</name>
1411                     </field>
1412                     <field>
1413                         <name>account_type</name>
1414                     </field>
1415                     <field>
1416                         <name>account_id</name>
1417                     </field>
1418                     <field>
1419                         <name>account_right</name>
1420                     </field>
1421                 </index>
1422                 <index>
1423                     <name>tag_id-account_type-account_id</name>
1424                     <field>
1425                         <name>tag_id</name>
1426                     </field>
1427                     <field>
1428                         <name>account_type</name>
1429                     </field>
1430                     <field>
1431                         <name>account_id</name>
1432                     </field>
1433                 </index>
1434                 <index>
1435                     <name>tags_acl::tag_id--tags::id</name>
1436                     <field>
1437                         <name>tag_id</name>
1438                     </field>
1439                     <foreign>true</foreign>
1440                     <reference>
1441                         <table>tags</table>
1442                         <field>id</field>
1443                     </reference>
1444                 </index>
1445             </declaration>
1446         </table>
1447
1448         <table>
1449             <name>tags_context</name>
1450             <version>1</version>
1451             <declaration>
1452                 <field>
1453                     <name>tag_id</name>
1454                     <type>text</type>
1455                     <length>40</length>
1456                     <notnull>true</notnull>
1457                 </field>
1458                 <field>
1459                     <name>application_id</name>
1460                     <type>text</type>
1461                     <length>40</length>
1462                     <notnull>true</notnull>
1463                 </field>
1464                 <index>
1465                     <name>tag_id-application_id</name>
1466                     <primary>true</primary>
1467                     <field>
1468                         <name>tag_id</name>
1469                     </field>
1470                     <field>
1471                         <name>application_id</name>
1472                     </field>
1473                 </index>
1474                 <index>
1475                     <name>application_id</name>
1476                     <field>
1477                         <name>application_id</name>
1478                     </field>
1479                 </index>
1480                 <index>
1481                     <name>tags_context::tag_id--tags::id</name>
1482                     <field>
1483                         <name>tag_id</name>
1484                     </field>
1485                     <foreign>true</foreign>
1486                     <reference>
1487                         <table>tags</table>
1488                         <field>id</field>
1489                         <!-- add onupdate/ondelete? -->
1490                     </reference>
1491                 </index>
1492
1493             </declaration>
1494         </table>
1495
1496         <table>
1497             <name>tagging</name>
1498             <version>1</version>
1499             <declaration>
1500                 <field>
1501                     <name>tag_id</name>
1502                     <type>text</type>
1503                     <length>40</length>
1504                     <notnull>true</notnull>
1505                 </field>
1506                 <field>
1507                     <name>application_id</name>
1508                     <type>text</type>
1509                     <length>40</length>
1510                     <notnull>true</notnull>
1511                 </field>
1512                 <field>
1513                     <name>record_id</name>
1514                     <type>text</type>
1515                     <length>40</length>
1516                     <notnull>true</notnull>
1517                 </field>
1518                 <field>
1519                     <name>record_backend_id</name>
1520                     <type>text</type>
1521                     <length>40</length>
1522                     <notnull>true</notnull>
1523                 </field>
1524                 <index>
1525                     <name>tag_id-application_id-record_id-record_backend_id</name>
1526                     <primary>true</primary>
1527                     <field>
1528                         <name>tag_id</name>
1529                     </field>
1530                     <field>
1531                         <name>application_id</name>
1532                     </field>
1533                     <field>
1534                         <name>record_id</name>
1535                     </field>
1536                     <field>
1537                         <name>record_backend_id</name>
1538                     </field>
1539                 </index>
1540
1541                 <index>
1542                     <name>application_id</name>
1543                     <field>
1544                         <name>application_id</name>
1545                     </field>
1546                 </index>
1547                 <index>
1548                     <name>record_id</name>
1549                     <field>
1550                         <name>record_id</name>
1551                     </field>
1552                 </index>
1553                 <index>
1554                     <name>tagging::tag_id--tags::id</name>
1555                     <field>
1556                         <name>tag_id</name>
1557                     </field>
1558                     <foreign>true</foreign>
1559                     <reference>
1560                         <table>tags</table>
1561                         <field>id</field>
1562                         <!-- add onupdate/ondelete? -->
1563                     </reference>
1564                 </index>
1565             </declaration>
1566         </table>
1567
1568         <table>
1569             <name>roles</name>
1570             <version>1</version>
1571             <declaration>
1572                 <field>
1573                     <name>id</name>
1574                     <type>integer</type>
1575                     <autoincrement>true</autoincrement>
1576                 </field>
1577                 <field>
1578                     <name>name</name>
1579                     <type>text</type>
1580                     <length>128</length>
1581                     <notnull>true</notnull>
1582                 </field>
1583                 <field>
1584                     <name>description</name>
1585                     <type>text</type>
1586                     <length>255</length>
1587                     <notnull>false</notnull>
1588                 </field>
1589                 <field>
1590                     <name>created_by</name>
1591                     <type>text</type>
1592                     <length>40</length>
1593                 </field>
1594                 <field>
1595                     <name>creation_time</name>
1596                     <type>datetime</type>
1597                 </field>
1598                 <field>
1599                     <name>last_modified_by</name>
1600                     <type>text</type>
1601                     <length>40</length>
1602                 </field>
1603                 <field>
1604                     <name>last_modified_time</name>
1605                     <type>datetime</type>
1606                 </field>
1607
1608                 <index>
1609                     <name>id</name>
1610                     <primary>true</primary>
1611                     <field>
1612                         <name>id</name>
1613                     </field>
1614                 </index>
1615                 <index>
1616                     <name>name</name>
1617                     <unique>true</unique>
1618                     <field>
1619                         <name>name</name>
1620                     </field>
1621                 </index>
1622             </declaration>
1623         </table>
1624
1625         <table>
1626             <name>role_rights</name>
1627             <version>1</version>
1628             <declaration>
1629                 <field>
1630                     <name>id</name>
1631                     <type>integer</type>
1632                     <autoincrement>true</autoincrement>
1633                 </field>
1634                 <field>
1635                     <name>role_id</name>
1636                     <type>integer</type>
1637                     <unsigned>true</unsigned>
1638                     <notnull>true</notnull>
1639                 </field>
1640                 <field>
1641                     <name>application_id</name>
1642                     <type>text</type>
1643                     <length>40</length>
1644                     <notnull>true</notnull>
1645                 </field>
1646                 <field>
1647                     <name>right</name>
1648                     <type>text</type>
1649                     <length>64</length>
1650                     <notnull>true</notnull>
1651                 </field>
1652
1653                 <index>
1654                     <name>id</name>
1655                     <primary>true</primary>
1656                     <field>
1657                         <name>id</name>
1658                     </field>
1659                 </index>
1660                 <index>
1661                     <name>role_id</name>
1662                     <field>
1663                         <name>role_id</name>
1664                     </field>
1665                 </index>
1666                 <index>
1667                     <name>application_id</name>
1668                     <field>
1669                         <name>application_id</name>
1670                     </field>
1671                 </index>
1672                 <index>
1673                     <name>role_rights::application_id--applications::id</name>
1674                     <field>
1675                         <name>application_id</name>
1676                     </field>
1677                     <foreign>true</foreign>
1678                     <reference>
1679                         <table>applications</table>
1680                         <field>id</field>
1681                         <!-- add onupdate/ondelete? -->
1682                     </reference>
1683                 </index>
1684                 <index>
1685                     <name>role_rights::role_id--roles::id</name>
1686                     <field>
1687                         <name>role_id</name>
1688                     </field>
1689                     <foreign>true</foreign>
1690                     <reference>
1691                         <table>roles</table>
1692                         <field>id</field>
1693                         <!-- add onupdate/ondelete? -->
1694                     </reference>
1695                 </index>
1696
1697
1698             </declaration>
1699         </table>
1700
1701         <table>
1702             <name>role_accounts</name>
1703             <version>2</version>
1704             <declaration>
1705                 <field>
1706                     <name>id</name>
1707                     <type>integer</type>
1708                     <autoincrement>true</autoincrement>
1709                 </field>
1710                 <field>
1711                     <name>role_id</name>
1712                     <type>integer</type>
1713                     <unsigned>true</unsigned>
1714                     <notnull>true</notnull>
1715                 </field>
1716                 <field>
1717                     <name>account_type</name>
1718                     <type>text</type>
1719                     <length>32</length>
1720                     <default>user</default>
1721                     <notnull>true</notnull>
1722                 </field>
1723                 <field>
1724                     <name>account_id</name>
1725                     <type>text</type>
1726                     <length>40</length>
1727                     <notnull>false</notnull>
1728                 </field>
1729
1730                 <index>
1731                     <name>id</name>
1732                     <primary>true</primary>
1733                     <field>
1734                         <name>id</name>
1735                     </field>
1736                 </index>
1737                 <index>
1738                     <name>account_id-account_type-role_id</name>
1739                     <unique>true</unique>
1740                     <field>
1741                         <name>role_id</name>
1742                     </field>
1743                     <field>
1744                         <name>account_id</name>
1745                     </field>
1746                     <field>
1747                         <name>account_type</name>
1748                     </field>
1749                 </index>
1750                 <index>
1751                     <name>role_accounts::role_id--roles::id</name>
1752                     <field>
1753                         <name>role_id</name>
1754                     </field>
1755                     <foreign>true</foreign>
1756                     <reference>
1757                         <table>roles</table>
1758                         <field>id</field>
1759                         <!-- add onupdate/ondelete? -->
1760                     </reference>
1761                 </index>
1762             </declaration>
1763         </table>
1764
1765         <table>
1766             <name>temp_files</name>
1767             <version>1</version>
1768             <declaration>
1769                 <field>
1770                     <name>id</name>
1771                     <type>text</type>
1772                     <length>40</length>
1773                     <notnull>true</notnull>
1774                 </field>
1775                 <field>
1776                     <name>session_id</name>
1777                     <type>text</type>
1778                     <notnull>true</notnull>
1779                 </field>
1780                 <field>
1781                     <name>time</name>
1782                     <type>datetime</type>
1783                 </field>
1784                 <field>
1785                     <name>path</name>
1786                     <type>text</type>
1787                     <notnull>true</notnull>
1788                 </field>
1789                 <field>
1790                     <name>name</name>
1791                     <type>text</type>
1792                     <notnull>true</notnull>
1793                 </field>
1794                 <field>
1795                     <name>type</name>
1796                     <type>text</type>
1797                     <notnull>true</notnull>
1798                 </field>
1799                 <field>
1800                     <name>error</name>
1801                     <type>integer</type>
1802                     <notnull>true</notnull>
1803                 </field>
1804                 <field>
1805                     <name>size</name>
1806                     <type>integer</type>
1807                     <unsigned>true</unsigned>
1808                     <notnull>true</notnull>
1809                 </field>
1810
1811                 <index>
1812                     <name>id</name>
1813                     <primary>true</primary>
1814                     <field>
1815                         <name>id</name>
1816                     </field>
1817                 </index>
1818             </declaration>
1819         </table>
1820
1821         <table>
1822             <name>config</name>
1823             <version>1</version>
1824             <declaration>
1825                 <field>
1826                     <name>id</name>
1827                     <type>text</type>
1828                     <length>40</length>
1829                     <notnull>true</notnull>
1830                 </field>
1831                 <field>
1832                     <name>application_id</name>
1833                     <type>text</type>
1834                     <length>40</length>
1835                     <notnull>true</notnull>
1836                 </field>
1837                 <field>
1838                     <name>name</name>
1839                     <type>text</type>
1840                     <length>255</length>
1841                     <notnull>true</notnull>
1842                 </field>
1843                 <field>
1844                     <name>value</name>
1845                     <type>text</type>
1846                     <notnull>true</notnull>
1847                 </field>
1848                 <index>
1849                     <name>id</name>
1850                     <primary>true</primary>
1851                     <field>
1852                         <name>id</name>
1853                     </field>
1854                 </index>
1855                 <index>
1856                     <name>application_id-name</name>
1857                     <unique>true</unique>
1858                     <field>
1859                         <name>application_id</name>
1860                     </field>
1861                     <field>
1862                         <name>name</name>
1863                     </field>
1864                 </index>
1865                 <index>
1866                     <name>config::application_id--applications::id</name>
1867                     <field>
1868                         <name>application_id</name>
1869                     </field>
1870                     <foreign>true</foreign>
1871                     <reference>
1872                         <table>applications</table>
1873                         <field>id</field>
1874                         <!-- add onupdate/ondelete? -->
1875                     </reference>
1876                 </index>
1877             </declaration>
1878         </table>
1879         <table>
1880             <name>preferences</name>
1881             <version>7</version>
1882             <declaration>
1883                 <field>
1884                     <name>id</name>
1885                     <type>text</type>
1886                     <length>40</length>
1887                     <notnull>true</notnull>
1888                 </field>
1889                 <field>
1890                     <name>account_type</name>
1891                     <type>text</type>
1892                     <length>32</length>
1893                     <default>user</default>
1894                     <notnull>true</notnull>
1895                 </field>
1896                 <field>
1897                     <name>account_id</name>
1898                     <type>text</type>
1899                     <length>40</length>
1900                     <notnull>false</notnull>
1901                 </field>
1902                 <field>
1903                     <name>application_id</name>
1904                     <type>text</type>
1905                     <length>40</length>
1906                     <notnull>true</notnull>
1907                 </field>
1908                 <field>
1909                     <name>name</name>
1910                     <type>text</type>
1911                     <length>100</length>
1912                     <notnull>true</notnull>
1913                 </field>
1914                 <field>
1915                     <name>value</name>
1916                     <type>text</type>
1917                     <notnull>true</notnull>
1918                 </field>
1919                 <field>
1920                     <name>type</name>
1921                     <type>text</type>
1922                     <length>40</length>
1923                 </field>
1924                 <field>
1925                     <name>options</name>
1926                     <type>text</type>
1927                 </field>
1928                 <field>
1929                     <name>personal_only</name>
1930                     <type>boolean</type>
1931                 </field>
1932                 <index>
1933                     <name>id</name>
1934                     <primary>true</primary>
1935                     <field>
1936                         <name>id</name>
1937                     </field>
1938                 </index>
1939                 <index>
1940                     <name>app_id-name-account_id-account_type</name>
1941                     <unique>true</unique>
1942                     <field>
1943                         <name>application_id</name>
1944                     </field>
1945                     <field>
1946                         <name>name</name>
1947                     </field>
1948                     <field>
1949                         <name>account_id</name>
1950                     </field>
1951                     <field>
1952                         <name>account_type</name>
1953                     </field>
1954                 </index>
1955                 <index>
1956                     <name>preferences::application_id--applications::id</name>
1957                     <field>
1958                         <name>application_id</name>
1959                     </field>
1960                     <foreign>true</foreign>
1961                     <reference>
1962                         <table>applications</table>
1963                         <field>id</field>
1964                         <ondelete>cascade</ondelete>
1965                         <!-- add onupdate/ondelete? -->
1966                     </reference>
1967                 </index>
1968                 <index>
1969                     <name>name</name>
1970                     <field>
1971                         <name>name</name>
1972                     </field>
1973                 </index>
1974                 <index>
1975                     <name>account_id</name>
1976                     <field>
1977                         <name>account_id</name>
1978                     </field>
1979                 </index>
1980                 <index>
1981                     <name>application_id</name>
1982                     <field>
1983                         <name>application_id</name>
1984                     </field>
1985                 </index>
1986             </declaration>
1987         </table>
1988         <table>
1989             <name>customfield</name>
1990             <version>3</version>
1991             <declaration>
1992                 <field>
1993                     <name>id</name>
1994                     <type>text</type>
1995                     <length>40</length>
1996                     <notnull>true</notnull>
1997                 </field>
1998                 <field>
1999                     <name>record_id</name>
2000                     <type>text</type>
2001                     <length>40</length>
2002                     <notnull>true</notnull>
2003                 </field>
2004                 <field>
2005                     <name>customfield_id</name>
2006                     <type>text</type>
2007                     <length>40</length>
2008                     <notnull>true</notnull>
2009                 </field>
2010                 <field>
2011                     <name>value</name>
2012                     <type>text</type>
2013                 </field>
2014                 <index>
2015                     <name>id</name>
2016                     <primary>true</primary>
2017                     <field>
2018                         <name>id</name>
2019                     </field>
2020                 </index>
2021                 <index>
2022                     <name>record_id_customfield_id</name>
2023                     <unique>true</unique>
2024                     <field>
2025                         <name>record_id</name>
2026                     </field>
2027                     <field>
2028                         <name>customfield_id</name>
2029                     </field>
2030                 </index>
2031                 <index>
2032                     <name>customfield_id</name>
2033                     <field>
2034                         <name>customfield_id</name>
2035                     </field>
2036                 </index>
2037             </declaration>
2038         </table>
2039         <table>
2040             <name>customfield_config</name>
2041             <version>5</version>
2042             <declaration>
2043                 <field>
2044                     <name>id</name>
2045                     <type>text</type>
2046                     <length>40</length>
2047                     <notnull>true</notnull>
2048                 </field>
2049                 <field>
2050                     <name>application_id</name>
2051                     <type>text</type>
2052                     <length>40</length>
2053                     <notnull>true</notnull>
2054                 </field>
2055                 <field>
2056                     <name>model</name>
2057                     <type>text</type>
2058                     <length>40</length>
2059                     <notnull>true</notnull>
2060                 </field>
2061                 <field>
2062                     <name>name</name>
2063                     <type>text</type>
2064                     <length>40</length>
2065                     <notnull>true</notnull>
2066                 </field>
2067                 <field>
2068                     <name>definition</name>
2069                     <type>text</type>
2070                 </field>
2071                 <index>
2072                     <name>id</name>
2073                     <primary>true</primary>
2074                     <field>
2075                         <name>id</name>
2076                     </field>
2077                 </index>
2078                 <index>
2079                     <name>application_id-name</name>
2080                     <unique>true</unique>
2081                     <field>
2082                         <name>application_id</name>
2083                     </field>
2084                     <field>
2085                         <name>name</name>
2086                     </field>
2087                 </index>
2088                 <index>
2089                     <name>config_customfields::application_id--applications::id</name>
2090                     <field>
2091                         <name>application_id</name>
2092                     </field>
2093                     <foreign>true</foreign>
2094                     <reference>
2095                         <table>applications</table>
2096                         <field>id</field>
2097                         <!-- add onupdate/ondelete? -->
2098                     </reference>
2099                 </index>
2100             </declaration>
2101         </table>
2102         <table>
2103             <name>customfield_acl</name>
2104             <version>2</version>
2105             <declaration>
2106                 <field>
2107                     <name>id</name>
2108                     <type>text</type>
2109                     <length>40</length>
2110                     <notnull>true</notnull>
2111                 </field>
2112                 <field>
2113                     <name>customfield_id</name>
2114                     <type>text</type>
2115                     <length>40</length>
2116                     <notnull>true</notnull>
2117                 </field>
2118                 <field>
2119                     <name>account_type</name>
2120                     <type>text</type>
2121                     <length>32</length>
2122                     <default>user</default>
2123                     <notnull>true</notnull>
2124                 </field>
2125                 <field>
2126                     <name>account_id</name>
2127                     <type>text</type>
2128                     <length>40</length>
2129                     <notnull>true</notnull>
2130                 </field>
2131                 <field>
2132                     <name>account_grant</name>
2133                     <type>text</type>
2134                     <length>40</length>
2135                     <notnull>true</notnull>
2136                 </field>
2137                 <index>
2138                     <name>customfield_id-account-type-account_id-account_grant</name>
2139                     <primary>true</primary>
2140                     <field>
2141                         <name>id</name>
2142                     </field>
2143                     <field>
2144                         <name>customfield_id</name>
2145                     </field>
2146                     <field>
2147                         <name>account_type</name>
2148                     </field>
2149                     <field>
2150                         <name>account_id</name>
2151                     </field>
2152                     <field>
2153                         <name>account_grant</name>
2154                     </field>
2155                 </index>
2156                 <index>
2157                     <name>id-account_type-account_id</name>
2158                     <field>
2159                         <name>customfield_id</name>
2160                     </field>
2161                     <field>
2162                         <name>account_type</name>
2163                     </field>
2164                     <field>
2165                         <name>account_id</name>
2166                     </field>
2167                 </index>
2168                 <index>
2169                     <name>customfield_acl::customfield_id--customfield_config::id</name>
2170                     <field>
2171                         <name>customfield_id</name>
2172                     </field>
2173                     <foreign>true</foreign>
2174                     <reference>
2175                         <table>customfield_config</table>
2176                         <field>id</field>
2177                         <ondelete>cascade</ondelete>
2178                         <!-- add onupdate? -->
2179                     </reference>
2180                 </index>
2181             </declaration>
2182         </table>
2183         <table>
2184             <name>note_types</name>
2185             <version>3</version>
2186             <declaration>
2187                 <field>
2188                     <name>id</name>
2189                     <type>text</type>
2190                     <length>40</length>
2191                     <notnull>true</notnull>
2192                 </field>
2193                 <field>
2194                     <name>name</name>
2195                     <type>text</type>
2196                     <length>64</length>
2197                     <notnull>true</notnull>
2198                 </field>
2199                 <field>
2200                     <name>description</name>
2201                     <type>text</type>
2202                     <length>255</length>
2203                     <default>NULL</default>
2204                 </field>
2205                 <field>
2206                     <name>icon</name>
2207                     <type>text</type>
2208                     <length>255</length>
2209                     <notnull>true</notnull>
2210                 </field>
2211                 <field>
2212                     <name>icon_class</name>
2213                     <type>text</type>
2214                     <length>128</length>
2215                     <default>NULL</default>
2216                 </field>
2217                 <field>
2218                     <name>is_user_type</name>
2219                     <type>boolean</type>
2220                     <notnull>true</notnull>
2221                     <default>true</default>
2222                 </field>
2223                 <index>
2224                     <name>id</name>
2225                     <primary>true</primary>
2226                     <field>
2227                         <name>id</name>
2228                     </field>
2229                 </index>
2230             </declaration>
2231         </table>
2232         <table>
2233             <name>notes</name>
2234             <version>2</version>
2235             <declaration>
2236                 <field>
2237                     <name>id</name>
2238                     <type>text</type>
2239                     <length>40</length>
2240                     <notnull>true</notnull>
2241                 </field>
2242                 <field>
2243                     <name>note_type_id</name>
2244                     <type>text</type>
2245                     <length>40</length>
2246                     <notnull>true</notnull>
2247                 </field>
2248                 <field>
2249                     <name>note</name>
2250                     <type>text</type>
2251                     <default>NULL</default>
2252                 </field>
2253                 <field>
2254                     <name>record_model</name>
2255                     <type>text</type>
2256                     <length>40</length>
2257                     <notnull>true</notnull>
2258                 </field>
2259                 <field>
2260                     <name>record_backend</name>
2261                     <type>text</type>
2262                     <length>40</length>
2263                     <notnull>true</notnull>
2264                 </field>
2265                 <field>
2266                     <name>record_id</name>
2267                     <type>text</type>
2268                     <length>40</length>
2269                     <notnull>true</notnull>
2270                 </field>
2271                 <field>
2272                     <name>created_by</name>
2273                     <type>text</type>
2274                     <length>40</length>
2275                 </field>
2276                 <field>
2277                     <name>creation_time</name>
2278                     <type>datetime</type>
2279                 </field>
2280                 <field>
2281                     <name>last_modified_by</name>
2282                     <type>text</type>
2283                     <length>40</length>
2284                 </field>
2285                 <field>
2286                     <name>last_modified_time</name>
2287                     <type>datetime</type>
2288                 </field>
2289                 <field>
2290                     <name>is_deleted</name>
2291                     <type>boolean</type>
2292                     <notnull>true</notnull>
2293                     <default>false</default>
2294                 </field>
2295                 <field>
2296                     <name>deleted_by</name>
2297                     <type>text</type>
2298                     <length>40</length>
2299                 </field>
2300                 <field>
2301                     <name>deleted_time</name>
2302                     <type>datetime</type>
2303                 </field>
2304                 <field>
2305                     <name>seq</name>
2306                     <type>integer</type>
2307                     <notnull>true</notnull>
2308                     <default>0</default>
2309                 </field>
2310                 <index>
2311                     <name>id</name>
2312                     <primary>true</primary>
2313                     <field>
2314                         <name>id</name>
2315                     </field>
2316                 </index>
2317                 <index>
2318                     <name>record_id</name>
2319                     <field>
2320                         <name>record_id</name>
2321                     </field>
2322                 </index>
2323                 <index>
2324                     <name>record_model</name>
2325                     <field>
2326                         <name>record_model</name>
2327                     </field>
2328                 </index>
2329                 <index>
2330                     <name>record_backend</name>
2331                     <field>
2332                         <name>record_backend</name>
2333                     </field>
2334                 </index>
2335                 <index>
2336                     <name>notes::note_type_id--note_types::id</name>
2337                     <field>
2338                         <name>note_type_id</name>
2339                     </field>
2340                     <foreign>true</foreign>
2341                     <reference>
2342                         <table>note_types</table>
2343                         <field>id</field>
2344                         <!-- add onupdate/ondelete? -->
2345                     </reference>
2346                 </index>
2347             </declaration>
2348         </table>
2349         <table>
2350             <name>filter</name>
2351             <version>5</version>
2352             <declaration>
2353                 <field>
2354                     <name>id</name>
2355                     <type>text</type>
2356                     <length>40</length>
2357                     <notnull>true</notnull>
2358                 </field>
2359                 <field>
2360                     <name>application_id</name>
2361                     <type>text</type>
2362                     <length>40</length>
2363                     <notnull>true</notnull>
2364                 </field>
2365                 <field>
2366                     <name>account_id</name>
2367                     <type>text</type>
2368                     <length>40</length>
2369                     <notnull>false</notnull>
2370                 </field>
2371                 <field>
2372                     <name>model</name>
2373                     <type>text</type>
2374                     <length>64</length>
2375                     <notnull>true</notnull>
2376                 </field>
2377                 <field>
2378                     <name>filters</name>
2379                     <type>text</type>
2380                     <notnull>true</notnull>
2381                 </field>
2382                 <field>
2383                     <name>name</name>
2384                     <type>text</type>
2385                     <length>40</length>
2386                     <notnull>true</notnull>
2387                 </field>
2388                 <field>
2389                     <name>description</name>
2390                     <type>text</type>
2391                     <notnull>false</notnull>
2392                 </field>
2393                 <field>
2394                     <name>created_by</name>
2395                     <type>text</type>
2396                     <length>40</length>
2397                 </field>
2398                 <field>
2399                     <name>creation_time</name>
2400                     <type>datetime</type>
2401                 </field>
2402                 <field>
2403                     <name>last_modified_by</name>
2404                     <type>text</type>
2405                     <length>40</length>
2406                 </field>
2407                 <field>
2408                     <name>last_modified_time</name>
2409                     <type>datetime</type>
2410                 </field>
2411                 <field>
2412                     <name>is_deleted</name>
2413                     <type>boolean</type>
2414                     <default>false</default>
2415                 </field>
2416                 <field>
2417                     <name>deleted_by</name>
2418                     <type>text</type>
2419                     <length>40</length>
2420                 </field>
2421                 <field>
2422                     <name>deleted_time</name>
2423                     <type>datetime</type>
2424                 </field>
2425                 <field>
2426                     <name>seq</name>
2427                     <type>integer</type>
2428                     <notnull>true</notnull>
2429                     <default>0</default>
2430                 </field>
2431                 <index>
2432                     <name>id</name>
2433                     <primary>true</primary>
2434                     <field>
2435                         <name>id</name>
2436                     </field>
2437                 </index>
2438                 <index>
2439                     <name>filter::application_id--applications::id</name>
2440                     <field>
2441                         <name>application_id</name>
2442                     </field>
2443                     <foreign>true</foreign>
2444                     <reference>
2445                         <table>applications</table>
2446                         <field>id</field>
2447                     </reference>
2448                 </index>
2449             </declaration>
2450         </table>
2451         <table>
2452             <name>filter_acl</name>
2453             <version>1</version>
2454             <declaration>
2455                 <field>
2456                     <name>id</name>
2457                     <type>text</type>
2458                     <length>40</length>
2459                     <notnull>true</notnull>
2460                 </field>
2461                 <field>
2462                     <name>record_id</name>
2463                     <type>text</type>
2464                     <length>40</length>
2465                     <notnull>true</notnull>
2466                 </field>
2467                 <field>
2468                     <name>account_type</name>
2469                     <type>text</type>
2470                     <length>32</length>
2471                     <default>user</default>
2472                     <notnull>true</notnull>
2473                 </field>
2474                 <field>
2475                     <name>account_id</name>
2476                     <type>text</type>
2477                     <length>40</length>
2478                     <notnull>true</notnull>
2479                 </field>
2480                 <field>
2481                     <name>account_grant</name>
2482                     <type>text</type>
2483                     <length>40</length>
2484                     <notnull>true</notnull>
2485                 </field>
2486                 <index>
2487                     <name>record_id-account-type-account_id-account_grant</name>
2488                     <primary>true</primary>
2489                     <field>
2490                         <name>id</name>
2491                     </field>
2492                     <field>
2493                         <name>record_id</name>
2494                     </field>
2495                     <field>
2496                         <name>account_type</name>
2497                     </field>
2498                     <field>
2499                         <name>account_id</name>
2500                     </field>
2501                     <field>
2502                         <name>account_grant</name>
2503                     </field>
2504                 </index>
2505                 <index>
2506                     <name>id-account_type-account_id</name>
2507                     <field>
2508                         <name>record_id</name>
2509                     </field>
2510                     <field>
2511                         <name>account_type</name>
2512                     </field>
2513                     <field>
2514                         <name>account_id</name>
2515                     </field>
2516                 </index>
2517                 <index>
2518                     <name>filter_acl::record_id--filter::id</name>
2519                     <field>
2520                         <name>record_id</name>
2521                     </field>
2522                     <foreign>true</foreign>
2523                     <reference>
2524                         <table>filter</table>
2525                         <field>id</field>
2526                         <ondelete>cascade</ondelete>
2527                     </reference>
2528                 </index>
2529             </declaration>
2530         </table>
2531         <table>
2532             <name>importexport_definition</name>
2533             <version>8</version>
2534             <declaration>
2535                 <field>
2536                     <name>id</name>
2537                     <type>text</type>
2538                     <length>40</length>
2539                     <notnull>true</notnull>
2540                 </field>
2541                 <field>
2542                     <name>application_id</name>
2543                     <type>text</type>
2544                     <length>40</length>
2545                     <notnull>true</notnull>
2546                 </field>
2547                 <field>
2548                     <name>label</name>
2549                     <type>text</type>
2550                     <length>128</length>
2551                     <notnull>false</notnull>
2552                 </field>
2553                 <field>
2554                     <name>model</name>
2555                     <type>text</type>
2556                     <length>64</length>
2557                     <notnull>true</notnull>
2558                 </field>
2559                 <field>
2560                     <name>name</name>
2561                     <type>text</type>
2562                     <length>40</length>
2563                     <notnull>true</notnull>
2564                 </field>
2565                 <field>
2566                     <name>description</name>
2567                     <type>text</type>
2568                     <notnull>false</notnull>
2569                 </field>
2570                 <field>
2571                     <name>type</name>
2572                     <type>text</type>
2573                     <length>32</length>
2574                     <notnull>true</notnull>
2575                 </field>
2576                 <field>
2577                     <name>plugin</name>
2578                     <type>text</type>
2579                     <length>64</length>
2580                     <notnull>true</notnull>
2581                 </field>
2582                 <field>
2583                     <name>plugin_options</name>
2584                     <type>text</type>
2585                 </field>
2586                 <field>
2587                     <name>filename</name>
2588                     <type>text</type>
2589                     <length>40</length>
2590                 </field>
2591                 <field>
2592                     <name>created_by</name>
2593                     <type>text</type>
2594                     <length>40</length>
2595                 </field>
2596                 <field>
2597                     <name>creation_time</name>
2598                     <type>datetime</type>
2599                 </field>
2600                 <field>
2601                     <name>last_modified_by</name>
2602                     <type>text</type>
2603                     <length>40</length>
2604                 </field>
2605                 <field>
2606                     <name>last_modified_time</name>
2607                     <type>datetime</type>
2608                 </field>
2609                 <field>
2610                     <name>is_deleted</name>
2611                     <type>boolean</type>
2612                     <default>false</default>
2613                 </field>
2614                 <field>
2615                     <name>deleted_by</name>
2616                     <type>text</type>
2617                     <length>40</length>
2618                 </field>
2619                 <field>
2620                     <name>deleted_time</name>
2621                     <type>datetime</type>
2622                 </field>
2623                 <field>
2624                     <name>seq</name>
2625                     <type>integer</type>
2626                     <notnull>true</notnull>
2627                     <default>0</default>
2628                 </field>
2629                 <index>
2630                     <name>id</name>
2631                     <primary>true</primary>
2632                     <field>
2633                         <name>id</name>
2634                     </field>
2635                 </index>
2636                 <index>
2637                     <name>model-name-type</name>
2638                     <unique>true</unique>
2639                     <field>
2640                         <name>model</name>
2641                     </field>
2642                     <field>
2643                         <name>name</name>
2644                     </field>
2645                     <field>
2646                         <name>type</name>
2647                     </field>
2648                 </index>
2649                 <index>
2650                     <name>importexport_definitions::app_id--applications::id</name>
2651                     <field>
2652                         <name>application_id</name>
2653                     </field>
2654                     <foreign>true</foreign>
2655                     <reference>
2656                         <table>applications</table>
2657                         <field>id</field>
2658                         <!-- add onupdate/ondelete? -->
2659                     </reference>
2660                 </index>
2661             </declaration>
2662         </table>
2663         <table>
2664             <name>alarm</name>
2665             <version>3</version>
2666             <declaration>
2667                 <field>
2668                     <name>id</name>
2669                     <type>text</type>
2670                     <length>40</length>
2671                     <notnull>true</notnull>
2672                 </field>
2673                 <field>
2674                     <name>record_id</name>
2675                     <type>text</type>
2676                     <length>40</length>
2677                     <notnull>true</notnull>
2678                 </field>
2679                 <field>
2680                     <name>model</name>
2681                     <type>text</type>
2682                     <length>40</length>
2683                     <notnull>true</notnull>
2684                 </field>
2685                 <field>
2686                     <name>alarm_time</name>
2687                     <type>datetime</type>
2688                 </field>
2689                 <field>
2690                     <name>sent_time</name>
2691                     <type>datetime</type>
2692                 </field>
2693                 <field>
2694                     <name>sent_status</name>
2695                     <type>text</type>
2696                     <length>32</length>
2697                     <default>pending</default>
2698                     <notnull>true</notnull>
2699                 </field>
2700                 <field>
2701                     <name>sent_message</name>
2702                     <type>text</type>
2703                 </field>
2704                 <field>
2705                     <name>options</name>
2706                     <type>text</type>
2707                 </field>
2708                 <index>
2709                     <name>id</name>
2710                     <primary>true</primary>
2711                     <field>
2712                         <name>id</name>
2713                     </field>
2714                 </index>
2715                 <index>
2716                     <name>record_id-model</name>
2717                     <field>
2718                         <name>record_id</name>
2719                     </field>
2720                     <field>
2721                         <name>model</name>
2722                     </field>
2723                 </index>
2724             </declaration>
2725         </table>
2726         <table>
2727             <name>import</name>
2728             <version>1</version>
2729             <declaration>
2730                 <field>
2731                     <name>id</name>
2732                     <type>text</type>
2733                     <length>80</length>
2734                     <notnull>true</notnull>
2735                 </field>
2736                 <field>
2737                     <name>timestamp</name>
2738                     <type>datetime</type>
2739                 </field>
2740                 <field>
2741                     <name>user_id</name>
2742                     <type>text</type>
2743                     <length>80</length>
2744                     <notnull>true</notnull>
2745                 </field>
2746                 <field>
2747                     <name>model</name>
2748                     <type>text</type>
2749                     <length>80</length>
2750                     <notnull>true</notnull>
2751                 </field>
2752                 <field>
2753                     <name>application_id</name>
2754                     <type>text</type>
2755                     <length>80</length>
2756                     <notnull>true</notnull>
2757                 </field>
2758                 <field>
2759                     <name>synctoken</name>
2760                     <type>text</type>
2761                     <length>80</length>
2762                 </field>
2763                 <field>
2764                     <name>container_id</name>
2765                     <length>80</length>
2766                     <type>text</type>
2767                 </field>
2768                 <field>
2769                     <name>sourcetype</name>
2770                     <type>text</type>
2771                     <notnull>true</notnull>
2772                 </field>
2773                 <field>
2774                     <name>interval</name>
2775                     <type>text</type>
2776                 </field>
2777                 <field>
2778                     <name>source</name>
2779                     <type>text</type>
2780                 </field>
2781                 <field>
2782                     <name>options</name>
2783                     <type>text</type>
2784                 </field>
2785                 <index>
2786                     <name>id</name>
2787                     <primary>true</primary>
2788                     <field>
2789                         <name>id</name>
2790                     </field>
2791                 </index>
2792                 <field>
2793                     <name>created_by</name>
2794                     <type>text</type>
2795                     <length>40</length>
2796                 </field>
2797                 <field>
2798                     <name>creation_time</name>
2799                     <type>datetime</type>
2800                 </field>
2801                 <field>
2802                     <name>last_modified_by</name>
2803                     <type>text</type>
2804                     <length>40</length>
2805                 </field>
2806                 <field>
2807                     <name>last_modified_time</name>
2808                     <type>datetime</type>
2809                 </field>
2810                 <field>
2811                     <name>is_deleted</name>
2812                     <type>boolean</type>
2813                     <notnull>true</notnull>
2814                     <default>false</default>
2815                 </field>
2816                 <field>
2817                     <name>deleted_by</name>
2818                     <type>text</type>
2819                     <length>40</length>
2820                 </field>
2821                 <field>
2822                     <name>deleted_time</name>
2823                     <type>datetime</type>
2824                 </field>
2825                 <field>
2826                     <name>seq</name>
2827                     <type>integer</type>
2828                     <notnull>true</notnull>
2829                     <default>0</default>
2830                 </field>
2831                 <index>
2832                     <name>import::application_id--applications::id</name>
2833                     <field>
2834                         <name>application_id</name>
2835                     </field>
2836                     <foreign>true</foreign>
2837                     <reference>
2838                         <table>applications</table>
2839                         <field>id</field>
2840                     </reference>
2841                 </index>
2842                 <index>
2843                     <name>import::user_id--accounts::id</name>
2844                     <field>
2845                         <name>user_id</name>
2846                     </field>
2847                     <foreign>true</foreign>
2848                     <reference>
2849                         <table>accounts</table>
2850                         <field>id</field>
2851                     </reference>
2852                 </index>
2853             </declaration>
2854         </table>
2855         <table>
2856             <name>async_job</name>
2857             <version>3</version>
2858             <declaration>
2859                 <field>
2860                     <name>id</name>
2861                     <type>text</type>
2862                     <length>40</length>
2863                     <notnull>true</notnull>
2864                 </field>
2865                 <field>
2866                     <name>name</name>
2867                     <type>text</type>
2868                     <length>64</length>
2869                 </field>
2870                 <field>
2871                     <name>start_time</name>
2872                     <type>datetime</type>
2873                 </field>
2874                 <field>
2875                     <name>end_time</name>
2876                     <type>datetime</type>
2877                 </field>
2878                 <field>
2879                     <name>status</name>
2880                     <type>text</type>
2881                     <length>32</length>
2882                 </field>
2883                 <field>
2884                     <name>seq</name>
2885                     <type>integer</type>
2886                     <length>64</length>
2887                 </field>
2888                 <field>
2889                     <name>message</name>
2890                     <type>text</type>
2891                 </field>
2892                 <index>
2893                     <name>id</name>
2894                     <primary>true</primary>
2895                     <field>
2896                         <name>id</name>
2897                     </field>
2898                 </index>
2899                 <index>
2900                     <name>name-seq</name>
2901                     <unique>true</unique>
2902                     <field>
2903                         <name>name</name>
2904                     </field>
2905                     <field>
2906                         <name>seq</name>
2907                     </field>
2908                 </index>
2909             </declaration>
2910         </table>
2911         <table>
2912             <name>state</name>
2913             <version>3</version>
2914             <declaration>
2915                 <field>
2916                     <name>id</name>
2917                     <type>text</type>
2918                     <length>40</length>
2919                     <notnull>true</notnull>
2920                 </field>
2921                 <field>
2922                     <name>state_id</name>
2923                     <type>text</type>
2924                     <length>128</length>
2925                     <notnull>true</notnull>
2926                 </field>
2927                 <field>
2928                     <name>user_id</name>
2929                     <type>text</type>
2930                     <length>40</length>
2931                     <notnull>true</notnull>
2932                 </field>
2933                 <field>
2934                     <name>data</name>
2935                     <type>clob</type>
2936                 </field>
2937                 <index>
2938                     <name>id</name>
2939                     <primary>true</primary>
2940                     <field>
2941                         <name>id</name>
2942                     </field>
2943                 </index>
2944                 <index>
2945                     <name>user_id--state_id</name>
2946                     <unique>true</unique>
2947                     <field>
2948                         <name>user_id</name>
2949                     </field>
2950                     <field>
2951                         <name>state_id</name>
2952                     </field>
2953                 </index>
2954             </declaration>
2955         </table>
2956         <table>
2957             <name>openid_assoc</name>
2958             <version>1</version>
2959             <declaration>
2960                 <field>
2961                     <name>id</name>
2962                     <type>text</type>
2963                     <length>40</length>
2964                     <notnull>true</notnull>
2965                 </field>
2966                 <field>
2967                     <name>macfunc</name>
2968                     <type>text</type>
2969                     <length>40</length>
2970                     <notnull>true</notnull>
2971                 </field>
2972                 <field>
2973                     <name>secret</name>
2974                     <type>text</type>
2975                     <length>254</length>
2976                     <notnull>true</notnull>
2977                 </field>
2978                 <field>
2979                     <name>expires</name>
2980                     <type>integer</type>
2981                     <notnull>true</notnull>
2982                 </field>
2983                 <index>
2984                     <name>id</name>
2985                     <primary>true</primary>
2986                     <field>
2987                         <name>id</name>
2988                     </field>
2989                 </index>
2990             </declaration>
2991         </table>
2992         <table>
2993             <name>openid_sites</name>
2994             <version>1</version>
2995             <declaration>
2996                 <field>
2997                     <name>id</name>
2998                     <type>text</type>
2999                     <length>40</length>
3000                     <notnull>true</notnull>
3001                 </field>
3002                 <field>
3003                     <name>account_id</name>
3004                     <type>text</type>
3005                     <length>40</length>
3006                     <notnull>true</notnull>
3007                 </field>
3008                 <field>
3009                     <name>site</name>
3010                     <type>text</type>
3011                     <length>254</length>
3012                     <notnull>true</notnull>
3013                 </field>
3014                 <field>
3015                     <name>trusted</name>
3016                     <type>text</type>
<