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 CREATE TABLE prefix_wiki (
9 id SERIAL8 PRIMARY KEY,
10 course INT8 NOT NULL default '0',
11 name varchar(255) NOT NULL default '',
12 summary text NOT NULL,
13 pagename varchar(255) ,
14 wtype VARCHAR default 'group' CHECK( wtype IN('teacher', 'group', 'student')),
15 ewikiprinttitle INT NOT NULL default '1',
16 htmlmode INT NOT NULL default '0',
17 ewikiacceptbinary INT NOT NULL default '0',
18 disablecamelcase INT NOT NULL default '0',
19 setpageflags INT NOT NULL default '1',
20 strippages INT NOT NULL default '1',
21 removepages INT NOT NULL default '1',
22 revertchanges INT NOT NULL default '1',
23 initialcontent varchar(255) ,
24 timemodified INT8 NOT NULL default '0'
27 CREATE INDEX prefix_wiki_course_idx ON prefix_wiki (course);
30 # Table structure for table mdl_wiki_entries
33 CREATE TABLE prefix_wiki_entries (
34 id SERIAL8 PRIMARY KEY,
35 wikiid INT8 NOT NULL default '0',
36 course INT8 NOT NULL default '0',
37 groupid INT8 NOT NULL default '0',
38 userid INT8 NOT NULL default '0',
39 pagename varchar(255) NOT NULL default '',
40 timemodified INT8 NOT NULL default '0'
43 CREATE INDEX prefix_wiki_entries_wikiid_idx ON prefix_wiki_entries (wikiid);
44 CREATE INDEX prefix_wiki_entries_userid_idx ON prefix_wiki_entries (userid);
45 CREATE INDEX prefix_wiki_entries_groupid_idx ON prefix_wiki_entries (groupid);
46 CREATE INDEX prefix_wiki_entries_course_idx ON prefix_wiki_entries (course);
47 CREATE INDEX prefix_wiki_entries_pagename_idx ON prefix_wiki_entries (pagename);
50 CREATE TABLE prefix_wiki_pages (
51 id SERIAL8 PRIMARY KEY,
52 pagename VARCHAR(160) NOT NULL,
53 version INTEGER NOT NULL DEFAULT 0,
54 flags INTEGER DEFAULT 0,
56 author VARCHAR(100) DEFAULT 'ewiki',
57 userid INTEGER NOT NULL DEFAULT 0,
58 created INTEGER DEFAULT 0,
59 lastmodified INTEGER DEFAULT 0,
62 hits INTEGER DEFAULT 0,
66 CREATE UNIQUE INDEX prefix_wiki_pages_pagename_version_wiki_uk ON prefix_wiki_pages (pagename, version, wiki) ;