rtm-ontopia 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,59 @@
1
+
2
+
3
+ drop index CLOB_TM_OCCURRENCE;
4
+ drop index CLOB_TM_VARIANT_NAME;
5
+ drop function tm_clob_value;
6
+
7
+
8
+ /*
9
+ alter table TM_SUBJECT_LOCATORS drop constraint FK_TM_SUBJECT_LOCATORS_1;
10
+ alter table TM_VARIANT_NAME_SCOPE drop constraint FK_TM_VARIANT_NAME_SCOPE_1;
11
+ alter table TM_VARIANT_NAME_SCOPE drop constraint FK_TM_VARIANT_NAME_SCOPE_2;
12
+ alter table TM_SUBJECT_IDENTIFIERS drop constraint FK_TM_SUBJECT_IDENTIFIERS_1;
13
+ alter table TM_TOPIC_MAP drop constraint FK_TM_TOPIC_MAP_1;
14
+ alter table TM_TOPIC_NAME_SCOPE drop constraint FK_TM_TOPIC_NAME_SCOPE_1;
15
+ alter table TM_TOPIC_NAME_SCOPE drop constraint FK_TM_TOPIC_NAME_SCOPE_2;
16
+ alter table TM_TOPIC_NAME drop constraint FK_TM_TOPIC_NAME_1;
17
+ alter table TM_TOPIC_NAME drop constraint FK_TM_TOPIC_NAME_2;
18
+ alter table TM_TOPIC_NAME drop constraint FK_TM_TOPIC_NAME_3;
19
+ alter table TM_TOPIC_NAME drop constraint FK_TM_TOPIC_NAME_4;
20
+ alter table TM_OCCURRENCE drop constraint FK_TM_OCCURRENCE_1;
21
+ alter table TM_OCCURRENCE drop constraint FK_TM_OCCURRENCE_2;
22
+ alter table TM_OCCURRENCE drop constraint FK_TM_OCCURRENCE_3;
23
+ alter table TM_OCCURRENCE drop constraint FK_TM_OCCURRENCE_4;
24
+ alter table TM_ASSOCIATION_SCOPE drop constraint FK_TM_ASSOCIATION_SCOPE_1;
25
+ alter table TM_ASSOCIATION_SCOPE drop constraint FK_TM_ASSOCIATION_SCOPE_2;
26
+ alter table TM_ITEM_IDENTIFIERS drop constraint FK_TM_ITEM_IDENTIFIERS_1;
27
+ alter table TM_TOPIC drop constraint FK_TM_TOPIC_1;
28
+ alter table TM_OCCURRENCE_SCOPE drop constraint FK_TM_OCCURRENCE_SCOPE_1;
29
+ alter table TM_OCCURRENCE_SCOPE drop constraint FK_TM_OCCURRENCE_SCOPE_2;
30
+ alter table TM_VARIANT_NAME drop constraint FK_TM_VARIANT_NAME_1;
31
+ alter table TM_VARIANT_NAME drop constraint FK_TM_VARIANT_NAME_2;
32
+ alter table TM_VARIANT_NAME drop constraint FK_TM_VARIANT_NAME_3;
33
+ alter table TM_ASSOCIATION drop constraint FK_TM_ASSOCIATION_1;
34
+ alter table TM_ASSOCIATION drop constraint FK_TM_ASSOCIATION_2;
35
+ alter table TM_ASSOCIATION drop constraint FK_TM_ASSOCIATION_3;
36
+ alter table TM_ASSOCIATION_ROLE drop constraint FK_TM_ASSOCIATION_ROLE_1;
37
+ alter table TM_ASSOCIATION_ROLE drop constraint FK_TM_ASSOCIATION_ROLE_2;
38
+ alter table TM_ASSOCIATION_ROLE drop constraint FK_TM_ASSOCIATION_ROLE_3;
39
+ alter table TM_ASSOCIATION_ROLE drop constraint FK_TM_ASSOCIATION_ROLE_4;
40
+ alter table TM_ASSOCIATION_ROLE drop constraint FK_TM_ASSOCIATION_ROLE_5;
41
+ alter table TM_TOPIC_TYPES drop constraint FK_TM_TOPIC_TYPES_1;
42
+ alter table TM_TOPIC_TYPES drop constraint FK_TM_TOPIC_TYPES_2;
43
+ */
44
+ drop table TM_SUBJECT_LOCATORS cascade constraints;
45
+ drop table TM_VARIANT_NAME_SCOPE cascade constraints;
46
+ drop table TM_SUBJECT_IDENTIFIERS cascade constraints;
47
+ drop table TM_TOPIC_MAP cascade constraints;
48
+ drop table TM_TOPIC_NAME_SCOPE cascade constraints;
49
+ drop table TM_TOPIC_NAME cascade constraints;
50
+ drop table TM_OCCURRENCE cascade constraints;
51
+ drop table TM_ASSOCIATION_SCOPE cascade constraints;
52
+ drop table TM_ITEM_IDENTIFIERS cascade constraints;
53
+ drop table TM_ADMIN_SEQUENCE cascade constraints;
54
+ drop table TM_TOPIC cascade constraints;
55
+ drop table TM_OCCURRENCE_SCOPE cascade constraints;
56
+ drop table TM_VARIANT_NAME cascade constraints;
57
+ drop table TM_ASSOCIATION cascade constraints;
58
+ drop table TM_ASSOCIATION_ROLE cascade constraints;
59
+ drop table TM_TOPIC_TYPES cascade constraints;
@@ -0,0 +1,191 @@
1
+ create table TM_SUBJECT_LOCATORS (
2
+ topic_id integer not null,
3
+ address varchar(512) not null
4
+ );
5
+
6
+ create table TM_VARIANT_NAME_SCOPE (
7
+ scoped_id integer not null,
8
+ theme_id integer not null,
9
+ constraint TM_VARIANT_NAME_SCOPE_pkey primary key (scoped_id, theme_id)
10
+ );
11
+
12
+ create table TM_SUBJECT_IDENTIFIERS (
13
+ topic_id integer not null,
14
+ address varchar(512) not null
15
+ );
16
+
17
+ create table TM_TOPIC_MAP (
18
+ id integer not null,
19
+ reifier_id integer null,
20
+ title varchar(128) null,
21
+ base_address varchar(512) null,
22
+ comments text null,
23
+ constraint TM_TOPIC_MAP_pkey primary key (id)
24
+ );
25
+
26
+ create table TM_TOPIC_NAME_SCOPE (
27
+ scoped_id integer not null,
28
+ theme_id integer not null,
29
+ constraint TM_TOPIC_NAME_SCOPE_pkey primary key (scoped_id, theme_id)
30
+ );
31
+
32
+ create table TM_TOPIC_NAME (
33
+ id integer not null,
34
+ topic_id integer not null,
35
+ topicmap_id integer not null,
36
+ reifier_id integer null,
37
+ type_id integer null,
38
+ content text null,
39
+ constraint TM_TOPIC_NAME_pkey primary key (id)
40
+ );
41
+
42
+ create table TM_OCCURRENCE (
43
+ id integer not null,
44
+ topic_id integer not null,
45
+ topicmap_id integer not null,
46
+ reifier_id integer null,
47
+ type_id integer null,
48
+ datatype_address varchar(512) null,
49
+ length integer null,
50
+ hashcode integer null,
51
+ content text null,
52
+ constraint TM_OCCURRENCE_pkey primary key (id)
53
+ );
54
+
55
+ create table TM_ASSOCIATION_SCOPE (
56
+ scoped_id integer not null,
57
+ theme_id integer not null,
58
+ constraint TM_ASSOCIATION_SCOPE_pkey primary key (scoped_id, theme_id)
59
+ );
60
+
61
+ create table TM_ITEM_IDENTIFIERS (
62
+ class varchar(1) not null,
63
+ tmobject_id integer not null,
64
+ topicmap_id integer not null,
65
+ address varchar(512) not null
66
+ );
67
+
68
+ create table TM_ADMIN_SEQUENCE (
69
+ seq_name varchar(32) not null,
70
+ seq_count integer not null,
71
+ constraint TM_ADMIN_SEQUENCE_pkey primary key (seq_name)
72
+ );
73
+
74
+ create table TM_TOPIC (
75
+ id integer not null,
76
+ topicmap_id integer not null,
77
+ reified_id varchar(32) null,
78
+ constraint TM_TOPIC_pkey primary key (id)
79
+ );
80
+
81
+ create table TM_OCCURRENCE_SCOPE (
82
+ scoped_id integer not null,
83
+ theme_id integer not null,
84
+ constraint TM_OCCURRENCE_SCOPE_pkey primary key (scoped_id, theme_id)
85
+ );
86
+
87
+ create table TM_VARIANT_NAME (
88
+ id integer not null,
89
+ name_id integer not null,
90
+ topicmap_id integer not null,
91
+ reifier_id integer null,
92
+ datatype_address varchar(512) null,
93
+ length integer null,
94
+ hashcode integer null,
95
+ content text null,
96
+ constraint TM_VARIANT_NAME_pkey primary key (id)
97
+ );
98
+
99
+ create table TM_ASSOCIATION (
100
+ id integer not null,
101
+ topicmap_id integer not null,
102
+ reifier_id integer null,
103
+ type_id integer null,
104
+ constraint TM_ASSOCIATION_pkey primary key (id)
105
+ );
106
+
107
+ create table TM_ASSOCIATION_ROLE (
108
+ id integer not null,
109
+ assoc_id integer not null,
110
+ topicmap_id integer not null,
111
+ reifier_id integer null,
112
+ type_id integer null,
113
+ player_id integer null,
114
+ constraint TM_ASSOCIATION_ROLE_pkey primary key (id)
115
+ );
116
+
117
+ create table TM_TOPIC_TYPES (
118
+ topic_id integer not null,
119
+ type_id integer not null,
120
+ constraint TM_TOPIC_TYPES_pkey primary key (topic_id, type_id)
121
+ );
122
+
123
+
124
+ /*
125
+ alter table TM_SUBJECT_LOCATORS add constraint FK_TM_SUBJECT_LOCATORS_1 foreign key (topic_id) references TM_TOPIC (id) deferrable initially deferred;
126
+ alter table TM_VARIANT_NAME_SCOPE add constraint FK_TM_VARIANT_NAME_SCOPE_1 foreign key (scoped_id) references TM_VARIANT_NAME (id) deferrable initially deferred;
127
+ alter table TM_VARIANT_NAME_SCOPE add constraint FK_TM_VARIANT_NAME_SCOPE_2 foreign key (theme_id) references TM_TOPIC (id) deferrable initially deferred;
128
+ alter table TM_SUBJECT_IDENTIFIERS add constraint FK_TM_SUBJECT_IDENTIFIERS_1 foreign key (topic_id) references TM_TOPIC (id) deferrable initially deferred;
129
+ alter table TM_TOPIC_MAP add constraint FK_TM_TOPIC_MAP_1 foreign key (reifier_id) references TM_TOPIC (id) deferrable initially deferred;
130
+ alter table TM_TOPIC_NAME_SCOPE add constraint FK_TM_TOPIC_NAME_SCOPE_1 foreign key (scoped_id) references TM_TOPIC_NAME (id) deferrable initially deferred;
131
+ alter table TM_TOPIC_NAME_SCOPE add constraint FK_TM_TOPIC_NAME_SCOPE_2 foreign key (theme_id) references TM_TOPIC (id) deferrable initially deferred;
132
+ alter table TM_TOPIC_NAME add constraint FK_TM_TOPIC_NAME_1 foreign key (topic_id) references TM_TOPIC (id) deferrable initially deferred;
133
+ alter table TM_TOPIC_NAME add constraint FK_TM_TOPIC_NAME_2 foreign key (topicmap_id) references TM_TOPIC_MAP (id) deferrable initially deferred;
134
+ alter table TM_TOPIC_NAME add constraint FK_TM_TOPIC_NAME_3 foreign key (reifier_id) references TM_TOPIC (id) deferrable initially deferred;
135
+ alter table TM_TOPIC_NAME add constraint FK_TM_TOPIC_NAME_4 foreign key (type_id) references TM_TOPIC (id) deferrable initially deferred;
136
+ alter table TM_OCCURRENCE add constraint FK_TM_OCCURRENCE_1 foreign key (topic_id) references TM_TOPIC (id) deferrable initially deferred;
137
+ alter table TM_OCCURRENCE add constraint FK_TM_OCCURRENCE_2 foreign key (topicmap_id) references TM_TOPIC_MAP (id) deferrable initially deferred;
138
+ alter table TM_OCCURRENCE add constraint FK_TM_OCCURRENCE_3 foreign key (reifier_id) references TM_TOPIC (id) deferrable initially deferred;
139
+ alter table TM_OCCURRENCE add constraint FK_TM_OCCURRENCE_4 foreign key (type_id) references TM_TOPIC (id) deferrable initially deferred;
140
+ alter table TM_ASSOCIATION_SCOPE add constraint FK_TM_ASSOCIATION_SCOPE_1 foreign key (scoped_id) references TM_ASSOCIATION (id) deferrable initially deferred;
141
+ alter table TM_ASSOCIATION_SCOPE add constraint FK_TM_ASSOCIATION_SCOPE_2 foreign key (theme_id) references TM_TOPIC (id) deferrable initially deferred;
142
+ alter table TM_ITEM_IDENTIFIERS add constraint FK_TM_ITEM_IDENTIFIERS_1 foreign key (topicmap_id) references TM_TOPIC_MAP (id) deferrable initially deferred;
143
+ alter table TM_TOPIC add constraint FK_TM_TOPIC_1 foreign key (topicmap_id) references TM_TOPIC_MAP (id) deferrable initially deferred;
144
+ alter table TM_OCCURRENCE_SCOPE add constraint FK_TM_OCCURRENCE_SCOPE_1 foreign key (scoped_id) references TM_OCCURRENCE (id) deferrable initially deferred;
145
+ alter table TM_OCCURRENCE_SCOPE add constraint FK_TM_OCCURRENCE_SCOPE_2 foreign key (theme_id) references TM_TOPIC (id) deferrable initially deferred;
146
+ alter table TM_VARIANT_NAME add constraint FK_TM_VARIANT_NAME_1 foreign key (name_id) references TM_TOPIC_NAME (id) deferrable initially deferred;
147
+ alter table TM_VARIANT_NAME add constraint FK_TM_VARIANT_NAME_2 foreign key (topicmap_id) references TM_TOPIC_MAP (id) deferrable initially deferred;
148
+ alter table TM_VARIANT_NAME add constraint FK_TM_VARIANT_NAME_3 foreign key (reifier_id) references TM_TOPIC (id) deferrable initially deferred;
149
+ alter table TM_ASSOCIATION add constraint FK_TM_ASSOCIATION_1 foreign key (topicmap_id) references TM_TOPIC_MAP (id) deferrable initially deferred;
150
+ alter table TM_ASSOCIATION add constraint FK_TM_ASSOCIATION_2 foreign key (reifier_id) references TM_TOPIC (id) deferrable initially deferred;
151
+ alter table TM_ASSOCIATION add constraint FK_TM_ASSOCIATION_3 foreign key (type_id) references TM_TOPIC (id) deferrable initially deferred;
152
+ alter table TM_ASSOCIATION_ROLE add constraint FK_TM_ASSOCIATION_ROLE_1 foreign key (assoc_id) references TM_ASSOCIATION (id) deferrable initially deferred;
153
+ alter table TM_ASSOCIATION_ROLE add constraint FK_TM_ASSOCIATION_ROLE_2 foreign key (topicmap_id) references TM_TOPIC_MAP (id) deferrable initially deferred;
154
+ alter table TM_ASSOCIATION_ROLE add constraint FK_TM_ASSOCIATION_ROLE_3 foreign key (reifier_id) references TM_TOPIC (id) deferrable initially deferred;
155
+ alter table TM_ASSOCIATION_ROLE add constraint FK_TM_ASSOCIATION_ROLE_4 foreign key (type_id) references TM_TOPIC (id) deferrable initially deferred;
156
+ alter table TM_ASSOCIATION_ROLE add constraint FK_TM_ASSOCIATION_ROLE_5 foreign key (player_id) references TM_TOPIC (id) deferrable initially deferred;
157
+ alter table TM_TOPIC_TYPES add constraint FK_TM_TOPIC_TYPES_1 foreign key (topic_id) references TM_TOPIC (id) deferrable initially deferred;
158
+ alter table TM_TOPIC_TYPES add constraint FK_TM_TOPIC_TYPES_2 foreign key (type_id) references TM_TOPIC (id) deferrable initially deferred;
159
+ */
160
+
161
+ create index TM_SUBJECT_LOCATORS_IX_oa on TM_SUBJECT_LOCATORS(topic_id, address);
162
+ create index TM_SUBJECT_LOCATORS_IX_am on TM_SUBJECT_LOCATORS(address, topic_id);
163
+ create index TM_VARIANT_NAME_SCOPE_IX_hs on TM_VARIANT_NAME_SCOPE(theme_id, scoped_id);
164
+ create index TM_SUBJECT_IDENTIFIERS_IX_oa on TM_SUBJECT_IDENTIFIERS(topic_id, address);
165
+ create index TM_SUBJECT_IDENTIFIERS_IX_am on TM_SUBJECT_IDENTIFIERS(address, topic_id);
166
+ create index TM_TOPIC_MAP_IX_ai on TM_TOPIC_MAP(base_address, id);
167
+ create index TM_TOPIC_NAME_SCOPE_IX_hs on TM_TOPIC_NAME_SCOPE(theme_id, scoped_id);
168
+ create index TM_TOPIC_NAME_IX_o on TM_TOPIC_NAME(topic_id);
169
+ create index TM_TOPIC_NAME_IX_myi on TM_TOPIC_NAME(topicmap_id, type_id, id);
170
+ create index TM_TOPIC_NAME_IX_mvi on TM_TOPIC_NAME(topicmap_id, content, id);
171
+ create index TM_OCCURRENCE_IX_o on TM_OCCURRENCE(topic_id);
172
+ create index TM_OCCURRENCE_IX_myi on TM_OCCURRENCE(topicmap_id, type_id, id);
173
+ create index TM_OCCURRENCE_IX_mhi on TM_OCCURRENCE(topicmap_id, hashcode, id);
174
+ create index TM_ASSOCIATION_SCOPE_IX_hs on TM_ASSOCIATION_SCOPE(theme_id, scoped_id);
175
+ create index TM_ITEM_IDENTIFIERS_IX_o on TM_ITEM_IDENTIFIERS(tmobject_id);
176
+ create index TM_ITEM_IDENTIFIERS_IX_maco on TM_ITEM_IDENTIFIERS(topicmap_id, address, class, tmobject_id);
177
+ create index TM_TOPIC_IX_im on TM_TOPIC(id, topicmap_id);
178
+ create index TM_OCCURRENCE_SCOPE_IX_hs on TM_OCCURRENCE_SCOPE(theme_id, scoped_id);
179
+ create index TM_VARIANT_NAME_IX_o on TM_VARIANT_NAME(name_id);
180
+ create index TM_VARIANT_NAME_IX_mhi on TM_VARIANT_NAME(topicmap_id, hashcode, id);
181
+ create index TM_ASSOCIATION_IX_myi on TM_ASSOCIATION(topicmap_id, type_id, id);
182
+ create index TM_ASSOCIATION_ROLE_IX_o on TM_ASSOCIATION_ROLE(assoc_id);
183
+ create index TM_ASSOCIATION_ROLE_IX_io on TM_ASSOCIATION_ROLE(id, assoc_id);
184
+ create index TM_ASSOCIATION_ROLE_IX_t on TM_ASSOCIATION_ROLE(player_id);
185
+ create index TM_ASSOCIATION_ROLE_IX_it on TM_ASSOCIATION_ROLE(id, player_id);
186
+ create index TM_ASSOCIATION_ROLE_IX_myi on TM_ASSOCIATION_ROLE(topicmap_id, type_id, id);
187
+ create index TM_ASSOCIATION_ROLE_IX_mtyio on TM_ASSOCIATION_ROLE(topicmap_id, player_id, type_id, id, assoc_id);
188
+ create index TM_TOPIC_TYPES_IX_yt on TM_TOPIC_TYPES(type_id, topic_id);
189
+
190
+ insert into TM_ADMIN_SEQUENCE values ('<GLOBAL>', 0);
191
+
@@ -0,0 +1,53 @@
1
+
2
+ /*
3
+ alter table TM_SUBJECT_LOCATORS drop constraint FK_TM_SUBJECT_LOCATORS_1;
4
+ alter table TM_VARIANT_NAME_SCOPE drop constraint FK_TM_VARIANT_NAME_SCOPE_1;
5
+ alter table TM_VARIANT_NAME_SCOPE drop constraint FK_TM_VARIANT_NAME_SCOPE_2;
6
+ alter table TM_SUBJECT_IDENTIFIERS drop constraint FK_TM_SUBJECT_IDENTIFIERS_1;
7
+ alter table TM_TOPIC_MAP drop constraint FK_TM_TOPIC_MAP_1;
8
+ alter table TM_TOPIC_NAME_SCOPE drop constraint FK_TM_TOPIC_NAME_SCOPE_1;
9
+ alter table TM_TOPIC_NAME_SCOPE drop constraint FK_TM_TOPIC_NAME_SCOPE_2;
10
+ alter table TM_TOPIC_NAME drop constraint FK_TM_TOPIC_NAME_1;
11
+ alter table TM_TOPIC_NAME drop constraint FK_TM_TOPIC_NAME_2;
12
+ alter table TM_TOPIC_NAME drop constraint FK_TM_TOPIC_NAME_3;
13
+ alter table TM_TOPIC_NAME drop constraint FK_TM_TOPIC_NAME_4;
14
+ alter table TM_OCCURRENCE drop constraint FK_TM_OCCURRENCE_1;
15
+ alter table TM_OCCURRENCE drop constraint FK_TM_OCCURRENCE_2;
16
+ alter table TM_OCCURRENCE drop constraint FK_TM_OCCURRENCE_3;
17
+ alter table TM_OCCURRENCE drop constraint FK_TM_OCCURRENCE_4;
18
+ alter table TM_ASSOCIATION_SCOPE drop constraint FK_TM_ASSOCIATION_SCOPE_1;
19
+ alter table TM_ASSOCIATION_SCOPE drop constraint FK_TM_ASSOCIATION_SCOPE_2;
20
+ alter table TM_ITEM_IDENTIFIERS drop constraint FK_TM_ITEM_IDENTIFIERS_1;
21
+ alter table TM_TOPIC drop constraint FK_TM_TOPIC_1;
22
+ alter table TM_OCCURRENCE_SCOPE drop constraint FK_TM_OCCURRENCE_SCOPE_1;
23
+ alter table TM_OCCURRENCE_SCOPE drop constraint FK_TM_OCCURRENCE_SCOPE_2;
24
+ alter table TM_VARIANT_NAME drop constraint FK_TM_VARIANT_NAME_1;
25
+ alter table TM_VARIANT_NAME drop constraint FK_TM_VARIANT_NAME_2;
26
+ alter table TM_VARIANT_NAME drop constraint FK_TM_VARIANT_NAME_3;
27
+ alter table TM_ASSOCIATION drop constraint FK_TM_ASSOCIATION_1;
28
+ alter table TM_ASSOCIATION drop constraint FK_TM_ASSOCIATION_2;
29
+ alter table TM_ASSOCIATION drop constraint FK_TM_ASSOCIATION_3;
30
+ alter table TM_ASSOCIATION_ROLE drop constraint FK_TM_ASSOCIATION_ROLE_1;
31
+ alter table TM_ASSOCIATION_ROLE drop constraint FK_TM_ASSOCIATION_ROLE_2;
32
+ alter table TM_ASSOCIATION_ROLE drop constraint FK_TM_ASSOCIATION_ROLE_3;
33
+ alter table TM_ASSOCIATION_ROLE drop constraint FK_TM_ASSOCIATION_ROLE_4;
34
+ alter table TM_ASSOCIATION_ROLE drop constraint FK_TM_ASSOCIATION_ROLE_5;
35
+ alter table TM_TOPIC_TYPES drop constraint FK_TM_TOPIC_TYPES_1;
36
+ alter table TM_TOPIC_TYPES drop constraint FK_TM_TOPIC_TYPES_2;
37
+ */
38
+ drop table TM_SUBJECT_LOCATORS cascade;
39
+ drop table TM_VARIANT_NAME_SCOPE cascade;
40
+ drop table TM_SUBJECT_IDENTIFIERS cascade;
41
+ drop table TM_TOPIC_MAP cascade;
42
+ drop table TM_TOPIC_NAME_SCOPE cascade;
43
+ drop table TM_TOPIC_NAME cascade;
44
+ drop table TM_OCCURRENCE cascade;
45
+ drop table TM_ASSOCIATION_SCOPE cascade;
46
+ drop table TM_ITEM_IDENTIFIERS cascade;
47
+ drop table TM_ADMIN_SEQUENCE cascade;
48
+ drop table TM_TOPIC cascade;
49
+ drop table TM_OCCURRENCE_SCOPE cascade;
50
+ drop table TM_VARIANT_NAME cascade;
51
+ drop table TM_ASSOCIATION cascade;
52
+ drop table TM_ASSOCIATION_ROLE cascade;
53
+ drop table TM_TOPIC_TYPES cascade;
@@ -0,0 +1,154 @@
1
+ create table TM_SUBJECT_LOCATORS (
2
+ topic_id integer not null,
3
+ address nvarchar(450) not null
4
+ );
5
+
6
+ create table TM_VARIANT_NAME_SCOPE (
7
+ scoped_id integer not null,
8
+ theme_id integer not null,
9
+ constraint TM_VARIANT_NAME_SCOPE_pkey primary key (scoped_id, theme_id)
10
+ );
11
+
12
+ create table TM_SUBJECT_IDENTIFIERS (
13
+ topic_id integer not null,
14
+ address nvarchar(450) not null
15
+ );
16
+
17
+ create table TM_TOPIC_MAP (
18
+ id integer not null,
19
+ reifier_id integer null,
20
+ title nvarchar(128) null,
21
+ base_address nvarchar(450) null,
22
+ comments nvarchar(4000) null,
23
+ constraint TM_TOPIC_MAP_pkey primary key (id)
24
+ );
25
+
26
+ create table TM_TOPIC_NAME_SCOPE (
27
+ scoped_id integer not null,
28
+ theme_id integer not null,
29
+ constraint TM_TOPIC_NAME_SCOPE_pkey primary key (scoped_id, theme_id)
30
+ );
31
+
32
+ create table TM_TOPIC_NAME (
33
+ id integer not null,
34
+ topic_id integer not null,
35
+ topicmap_id integer not null,
36
+ reifier_id integer null,
37
+ type_id integer null,
38
+ content nvarchar(4000) null,
39
+ constraint TM_TOPIC_NAME_pkey primary key (id)
40
+ );
41
+
42
+ create table TM_OCCURRENCE (
43
+ id integer not null,
44
+ topic_id integer not null,
45
+ topicmap_id integer not null,
46
+ reifier_id integer null,
47
+ type_id integer null,
48
+ datatype_address nvarchar(450) null,
49
+ length integer null,
50
+ hashcode integer null,
51
+ content nvarchar(MAX) null,
52
+ constraint TM_OCCURRENCE_pkey primary key (id)
53
+ );
54
+
55
+ create table TM_ASSOCIATION_SCOPE (
56
+ scoped_id integer not null,
57
+ theme_id integer not null,
58
+ constraint TM_ASSOCIATION_SCOPE_pkey primary key (scoped_id, theme_id)
59
+ );
60
+
61
+ create table TM_ITEM_IDENTIFIERS (
62
+ class nvarchar(1) not null,
63
+ tmobject_id integer not null,
64
+ topicmap_id integer not null,
65
+ address nvarchar(450) not null
66
+ );
67
+
68
+ create table TM_ADMIN_SEQUENCE (
69
+ seq_name nvarchar(32) not null,
70
+ seq_count integer not null,
71
+ constraint TM_ADMIN_SEQUENCE_pkey primary key (seq_name)
72
+ );
73
+
74
+ create table TM_TOPIC (
75
+ id integer not null,
76
+ topicmap_id integer not null,
77
+ reified_id nvarchar(32) null,
78
+ constraint TM_TOPIC_pkey primary key (id)
79
+ );
80
+
81
+ create table TM_OCCURRENCE_SCOPE (
82
+ scoped_id integer not null,
83
+ theme_id integer not null,
84
+ constraint TM_OCCURRENCE_SCOPE_pkey primary key (scoped_id, theme_id)
85
+ );
86
+
87
+ create table TM_VARIANT_NAME (
88
+ id integer not null,
89
+ name_id integer not null,
90
+ topicmap_id integer not null,
91
+ reifier_id integer null,
92
+ datatype_address nvarchar(450) null,
93
+ length integer null,
94
+ hashcode integer null,
95
+ content nvarchar(MAX) null,
96
+ constraint TM_VARIANT_NAME_pkey primary key (id)
97
+ );
98
+
99
+ create table TM_ASSOCIATION (
100
+ id integer not null,
101
+ topicmap_id integer not null,
102
+ reifier_id integer null,
103
+ type_id integer null,
104
+ constraint TM_ASSOCIATION_pkey primary key (id)
105
+ );
106
+
107
+ create table TM_ASSOCIATION_ROLE (
108
+ id integer not null,
109
+ assoc_id integer not null,
110
+ topicmap_id integer not null,
111
+ reifier_id integer null,
112
+ type_id integer null,
113
+ player_id integer null,
114
+ constraint TM_ASSOCIATION_ROLE_pkey primary key (id)
115
+ );
116
+
117
+ create table TM_TOPIC_TYPES (
118
+ topic_id integer not null,
119
+ type_id integer not null,
120
+ constraint TM_TOPIC_TYPES_pkey primary key (topic_id, type_id)
121
+ );
122
+
123
+
124
+ create index TM_SUBJECT_LOCATORS_IX_oa on TM_SUBJECT_LOCATORS(topic_id, address);
125
+ create index TM_SUBJECT_LOCATORS_IX_am on TM_SUBJECT_LOCATORS(address, topic_id);
126
+ create index TM_VARIANT_NAME_SCOPE_IX_hs on TM_VARIANT_NAME_SCOPE(theme_id, scoped_id);
127
+ create index TM_SUBJECT_IDENTIFIERS_IX_oa on TM_SUBJECT_IDENTIFIERS(topic_id, address);
128
+ create index TM_SUBJECT_IDENTIFIERS_IX_am on TM_SUBJECT_IDENTIFIERS(address, topic_id);
129
+ create index TM_TOPIC_MAP_IX_ai on TM_TOPIC_MAP(base_address, id);
130
+ create index TM_TOPIC_NAME_SCOPE_IX_hs on TM_TOPIC_NAME_SCOPE(theme_id, scoped_id);
131
+ create index TM_TOPIC_NAME_IX_o on TM_TOPIC_NAME(topic_id);
132
+ create index TM_TOPIC_NAME_IX_myi on TM_TOPIC_NAME(topicmap_id, type_id, id);
133
+ create index TM_TOPIC_NAME_IX_mvi on TM_TOPIC_NAME(topicmap_id, content, id);
134
+ create index TM_OCCURRENCE_IX_o on TM_OCCURRENCE(topic_id);
135
+ create index TM_OCCURRENCE_IX_myi on TM_OCCURRENCE(topicmap_id, type_id, id);
136
+ create index TM_OCCURRENCE_IX_mhi on TM_OCCURRENCE(topicmap_id, hashcode, id);
137
+ create index TM_ASSOCIATION_SCOPE_IX_hs on TM_ASSOCIATION_SCOPE(theme_id, scoped_id);
138
+ create index TM_ITEM_IDENTIFIERS_IX_o on TM_ITEM_IDENTIFIERS(tmobject_id);
139
+ create index TM_ITEM_IDENTIFIERS_IX_maco on TM_ITEM_IDENTIFIERS(topicmap_id, address, class, tmobject_id);
140
+ create index TM_TOPIC_IX_im on TM_TOPIC(id, topicmap_id);
141
+ create index TM_OCCURRENCE_SCOPE_IX_hs on TM_OCCURRENCE_SCOPE(theme_id, scoped_id);
142
+ create index TM_VARIANT_NAME_IX_o on TM_VARIANT_NAME(name_id);
143
+ create index TM_VARIANT_NAME_IX_mhi on TM_VARIANT_NAME(topicmap_id, hashcode, id);
144
+ create index TM_ASSOCIATION_IX_myi on TM_ASSOCIATION(topicmap_id, type_id, id);
145
+ create index TM_ASSOCIATION_ROLE_IX_o on TM_ASSOCIATION_ROLE(assoc_id);
146
+ create index TM_ASSOCIATION_ROLE_IX_io on TM_ASSOCIATION_ROLE(id, assoc_id);
147
+ create index TM_ASSOCIATION_ROLE_IX_t on TM_ASSOCIATION_ROLE(player_id);
148
+ create index TM_ASSOCIATION_ROLE_IX_it on TM_ASSOCIATION_ROLE(id, player_id);
149
+ create index TM_ASSOCIATION_ROLE_IX_myi on TM_ASSOCIATION_ROLE(topicmap_id, type_id, id);
150
+ create index TM_ASSOCIATION_ROLE_IX_mtyio on TM_ASSOCIATION_ROLE(topicmap_id, player_id, type_id, id, assoc_id);
151
+ create index TM_TOPIC_TYPES_IX_yt on TM_TOPIC_TYPES(type_id, topic_id);
152
+
153
+ insert into TM_ADMIN_SEQUENCE values ('<GLOBAL>', 0);
154
+