Automatic installer.php lang files by installer_builder (20070310)
[moodle.git] / mod / wiki / db / mysql.sql
blobf69b494a566bd60286911934fb194c07e5711fab
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` int(10) unsigned NOT NULL auto_increment,
10   `course` int(10) unsigned NOT NULL default '0',
11   `name` varchar(255) NOT NULL default '',
12   `summary` text NOT NULL default '',
13   `pagename` varchar(255) NOT NULL default '',
14   `wtype` enum('teacher','group','student') NOT NULL default 'group',
15   `ewikiprinttitle` tinyint(4) NOT NULL default '1',
16   `htmlmode` tinyint(4) NOT NULL default '0',
17   `ewikiacceptbinary` tinyint(4) NOT NULL default '0',
18   `disablecamelcase` tinyint(4) NOT NULL default '0',
19   `setpageflags` tinyint(4) NOT NULL default '1',
20   `strippages` tinyint(4) NOT NULL default '1',
21   `removepages` tinyint(4) NOT NULL default '1',
22   `revertchanges` tinyint(4) NOT NULL default '1',
23   `initialcontent` varchar(255) NOT NULL default '',
24   `timemodified` int(10) NOT NULL default '0',
25   PRIMARY KEY  (`id`),
26   KEY `course` (`course`)
27 ) TYPE=MyISAM COMMENT='Main wiki table';
31 # Table structure for table `mdl_wiki_entries`
34 CREATE TABLE `prefix_wiki_entries` (
35   `id` int(10) NOT NULL auto_increment,
36   `wikiid` int(10) NOT NULL default '0',
37   `course` int(10) NOT NULL default '0',
38   `groupid` int(10) NOT NULL default '0',
39   `userid` int(10) NOT NULL default '0',
40   `pagename` varchar(255) NOT NULL default '',
41   `timemodified` int(10) NOT NULL default '0',
42   PRIMARY KEY  (`id`),
43   KEY `wikiid` (`wikiid`),
44   KEY `course` (`course`),
45   KEY `gropuid` (`groupid`),
46   KEY `userid` (`userid`),
47   KEY `pagename` (`pagename`)
48 ) TYPE=MyISAM COMMENT='Holds entries for each wiki start instance.';
51 CREATE TABLE `prefix_wiki_pages` (
52   `id` int(10) unsigned NOT NULL auto_increment,
53   `pagename` VARCHAR(160) NOT NULL,
54   `version` INTEGER UNSIGNED NOT NULL DEFAULT 0,
55   `flags` INTEGER UNSIGNED DEFAULT 0,
56   `content` MEDIUMTEXT default '',
57   `author` VARCHAR(100) DEFAULT 'ewiki',
58   `userid` INTEGER UNSIGNED NOT NULL DEFAULT 0,
59   `created` INTEGER UNSIGNED DEFAULT 0,
60   `lastmodified` INTEGER UNSIGNED DEFAULT 0,
61   `refs` MEDIUMTEXT default '',
62   `meta` MEDIUMTEXT default '',
63   `hits` INTEGER UNSIGNED DEFAULT 0,
64   `wiki` int(10) unsigned NOT NULL default 0,
65   PRIMARY KEY `id` (`id`),
66   UNIQUE KEY `wiki_pages_uk` (`pagename`, `version`, `wiki`)
67 ) TYPE=MyISAM COMMENT='Holds the Wiki-Pages';