1 # This file contains a complete database schema for all the
2 # tables used by this module, written in SQL
4 # It may also contain INSERT statements for particular data
5 # that may be used, especially new entries in the table log_display
8 # Table structure for table `glossary`
11 CREATE TABLE prefix_glossary (
13 course int4 NOT NULL default '0',
14 name varchar(255) NOT NULL default '',
15 intro text NOT NULL default '',
16 studentcanpost int2 NOT NULL default '0',
17 allowduplicatedentries int2 NOT NULL default '0',
18 displayformat varchar(50) NOT NULL default 'dictionary',
19 mainglossary int2 NOT NULL default '0',
20 showspecial int2 NOT NULL default '1',
21 showalphabet int2 NOT NULL default '1',
22 showall int2 NOT NULL default '1',
23 allowcomments int2 NOT NULL default '0',
24 allowprintview int2 NOT NULL default '1',
25 usedynalink int2 NOT NULL default '1',
26 defaultapproval int2 NOT NULL default '1',
27 globalglossary int2 NOT NULL default '0',
28 entbypage int NOT NULL default '10',
29 editalways integer NOT NULL default '0',
30 rsstype integer NOT NULL default '0',
31 rssarticles integer NOT NULL default '0',
32 assessed int4 NOT NULL default '0',
33 assesstimestart int4 NOT NULL default '0',
34 assesstimefinish int4 NOT NULL default '0',
35 scale int4 NOT NULL default '0',
36 timecreated int4 NOT NULL default '0',
37 timemodified int4 NOT NULL default '0',
41 CREATE INDEX prefix_glossary_course_idx ON prefix_glossary (course);
45 # Table structure for table `glossary_entries`
48 CREATE TABLE prefix_glossary_entries (
50 glossaryid int4 NOT NULL default '0',
51 userid int4 NOT NULL default '0',
52 concept varchar(255) NOT NULL default '',
53 definition text NOT NULL,
54 format int2 NOT NULL default '0',
55 attachment VARCHAR(100) NOT NULL default '',
56 timecreated int4 NOT NULL default '0',
57 timemodified int4 NOT NULL default '0',
58 teacherentry int2 NOT NULL default '0',
59 sourceglossaryid int4 NOT NULL default '0',
60 usedynalink int2 NOT NULL default '1',
61 casesensitive int2 NOT NULL default '0',
62 fullmatch int2 NOT NULL default '1',
63 approved int2 NOT NULL default '1',
67 CREATE INDEX prefix_glossary_entries_glossaryid_idx ON prefix_glossary_entries (glossaryid);
68 CREATE INDEX prefix_glossary_entries_userid_idx ON prefix_glossary_entries (userid);
69 CREATE INDEX prefix_glossary_entries_concept_idx ON prefix_glossary_entries (concept);
72 # Table structure for table `glossary_cageories`
75 CREATE TABLE prefix_glossary_categories (
77 glossaryid int4 NOT NULL default '0',
78 name varchar(255) NOT NULL default '',
79 usedynalink int2 NOT NULL default '1',
83 CREATE INDEX prefix_glossary_categories_glossaryid_idx ON prefix_glossary_categories (glossaryid);
86 # Table structure for table `glossary_alias`
89 CREATE TABLE prefix_glossary_alias (
91 entryid int4 NOT NULL default '0',
92 alias varchar(255) NOT NULL,
96 CREATE INDEX prefix_glossary_alias_entryid_idx ON prefix_glossary_alias (entryid);
99 # Table structure for table `glossary_entries_category`
102 CREATE TABLE prefix_glossary_entries_categories (
104 categoryid int4 NOT NULL default '0',
105 entryid int4 NOT NULL default '0',
109 CREATE INDEX prefix_glossary_entries_categories_category_idx ON prefix_glossary_entries_categories (categoryid);
110 CREATE INDEX prefix_glossary_entries_categories_entryid_idx ON prefix_glossary_entries_categories (entryid);
113 # Table structure for table `glossary_comments`
116 CREATE TABLE prefix_glossary_comments (
118 entryid int4 NOT NULL default '0',
119 userid int4 NOT NULL default '0',
120 entrycomment text NOT NULL,
121 format int2 NOT NULL default '0',
122 timemodified int4 NOT NULL default '0',
126 CREATE INDEX prefix_glossary_comments_entryid_idx ON prefix_glossary_comments (entryid);
127 CREATE INDEX prefix_glossary_comments_userid_idx ON prefix_glossary_comments (userid);
130 # Table structure for table `glossary_formats`
133 CREATE TABLE prefix_glossary_formats (
135 name varchar(50) NOT NULL,
136 popupformatname varchar(50) NOT NULL,
137 visible int2 NOT NULL default '1',
138 showgroup int2 NOT NULL default '1',
139 defaultmode varchar(50) NOT NULL default '',
140 defaulthook varchar(50) NOT NULL default '',
141 sortkey varchar(50) NOT NULL default '',
142 sortorder varchar(50) NOT NULL default '',
148 # Table structure for table `glossary_ratings`
151 CREATE TABLE prefix_glossary_ratings (
153 userid int4 NOT NULL default '0',
154 entryid int4 NOT NULL default '0',
155 time int4 NOT NULL default '0',
156 rating int4 NOT NULL default '0',
160 CREATE INDEX prefix_glossary_ratings_userid_idx ON prefix_glossary_ratings (userid);
161 CREATE INDEX prefix_glossary_ratings_entryid_idx ON prefix_glossary_ratings (entryid);
164 # Dumping data for table `log_display`
167 INSERT INTO prefix_log_display (module, action, mtable, field) VALUES ('glossary', 'add', 'glossary', 'name');
168 INSERT INTO prefix_log_display (module, action, mtable, field) VALUES ('glossary', 'update', 'glossary', 'name');
169 INSERT INTO prefix_log_display (module, action, mtable, field) VALUES ('glossary', 'view', 'glossary', 'name');
170 INSERT INTO prefix_log_display (module, action, mtable, field) VALUES ('glossary', 'view all', 'glossary', 'name');
171 INSERT INTO prefix_log_display (module, action, mtable, field) VALUES ('glossary', 'add entry', 'glossary', 'name');
172 INSERT INTO prefix_log_display (module, action, mtable, field) VALUES ('glossary', 'update entry', 'glossary', 'name');
173 INSERT INTO prefix_log_display (module, action, mtable, field) VALUES ('glossary', 'add category', 'glossary', 'name');
174 INSERT INTO prefix_log_display (module, action, mtable, field) VALUES ('glossary', 'update category', 'glossary', 'name');
175 INSERT INTO prefix_log_display (module, action, mtable, field) VALUES ('glossary', 'delete category', 'glossary', 'name');
176 INSERT INTO prefix_log_display (module, action, mtable, field) VALUES ('glossary', 'add comment', 'glossary', 'name');
177 INSERT INTO prefix_log_display (module, action, mtable, field) VALUES ('glossary', 'update comment', 'glossary', 'name');
178 INSERT INTO prefix_log_display (module, action, mtable, field) VALUES ('glossary', 'delete comment', 'glossary', 'name');
179 INSERT INTO prefix_log_display (module, action, mtable, field) VALUES ('glossary', 'approve entry', 'glossary', 'name');
180 INSERT INTO prefix_log_display (module, action, mtable, field) VALUES ('glossary', 'view entry', 'glossary_entries', 'concept');