fixed log action inserts
[moodle.git] / db / mysql.sql
CommitLineData
e4a0993b 1# $Id: mysql.sql,v 1.2 2006/04/24 19:35:48 skodak Exp $
02039379
PS
2
3# This file contains a complete database schema for all the
4# tables used by the book module, written in SQL
5
6# It may also contain INSERT statements for particular data
7# that may be used, especially new entries in the table log_display
8
9CREATE TABLE prefix_book (
10 id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
11 course INT(10) UNSIGNED NOT NULL DEFAULT '0',
12 name VARCHAR(255) NOT NULL DEFAULT '',
13 summary TEXT NOT NULL DEFAULT '',
14 numbering TINYINT(4) UNSIGNED NOT NULL DEFAULT '0',
15 disableprinting TINYINT(2) UNSIGNED NOT NULL DEFAULT '0',
16 customtitles TINYINT(2) UNSIGNED NOT NULL DEFAULT '0',
17 timecreated INT(10) UNSIGNED NOT NULL DEFAULT '0',
18 timemodified INT(10) UNSIGNED NOT NULL DEFAULT '0',
19 PRIMARY KEY (id)
20) COMMENT='Defines book';
21# --------------------------------------------------------
22
23CREATE TABLE prefix_book_chapters (
24 id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
25 bookid INT(10) UNSIGNED NOT NULL DEFAULT '0',
26 pagenum INT(10) UNSIGNED NOT NULL DEFAULT '0',
27 subchapter TINYINT(2) UNSIGNED NOT NULL DEFAULT '0',
28 title VARCHAR(255) NOT NULL DEFAULT '',
29 content LONGTEXT NOT NULL DEFAULT '',
30 hidden TINYINT(2) UNSIGNED NOT NULL DEFAULT '0',
31 timecreated INT(10) UNSIGNED NOT NULL DEFAULT '0',
32 timemodified INT(10) UNSIGNED NOT NULL DEFAULT '0',
33 importsrc VARCHAR(255) NOT NULL DEFAULT '',
34 PRIMARY KEY (id)
35) COMMENT='Defines book_chapters';
36# --------------------------------------------------------
37
e4a0993b
PS
38INSERT INTO prefix_log_display (module, action, mtable, field) VALUES ('book', 'update', 'book', 'name');
39INSERT INTO prefix_log_display (module, action, mtable, field) VALUES ('book', 'view', 'book', 'name');
40INSERT INTO prefix_log_display (module, action, mtable, field) VALUES ('book', 'view all', 'book', 'name');
41INSERT INTO prefix_log_display (module, action, mtable, field) VALUES ('book', 'print', 'book', 'name');