PhpWiki PHP Cross Reference Collaborative Wikis

Source: /schemas/mssql-initialize.sql - 125 lines - 3896 bytes - Text - Print

   1  -- $Id: mssql-initialize.sql 6203 2008-08-26 13:23:56Z vargenau $
   2  -- UNTESTED!
   3  
   4  CREATE TABLE page (
   5      id              INT NOT NULL AUTO_INCREMENT,
   6          pagename        VARCHAR(100) NOT NULL,
   7      hits            INT NOT NULL DEFAULT 0,
   8          pagedata        TEXT NOT NULL DEFAULT '',
   9      cached_html     TEXT NOT NULL DEFAULT '',   -- added with 1.3.11
  10          PRIMARY KEY (id),
  11      UNIQUE (pagename)
  12  );
  13  
  14  CREATE TABLE version (
  15      id              INT NOT NULL,
  16          version         INT NOT NULL,
  17      mtime           INT NOT NULL,
  18      minor_edit      TINYINT DEFAULT 0,
  19          content         TEXT NOT NULL DEFAULT '',
  20          versiondata     TEXT NOT NULL DEFAULT '',
  21          PRIMARY KEY (id,version)
  22  );
  23  CREATE INDEX version_mtime ON version (mtime);
  24  
  25  CREATE TABLE recent (
  26      id              INT NOT NULL,
  27      latestversion   INT,
  28      latestmajor     INT,
  29      latestminor     INT,
  30          PRIMARY KEY (id)
  31  );
  32  
  33  CREATE TABLE nonempty (
  34      id              INT NOT NULL,
  35      PRIMARY KEY (id)
  36  );
  37  
  38  CREATE TABLE link (
  39      linkfrom        INT NOT NULL,
  40          linkto          INT NOT NULL
  41  );
  42  CREATE INDEX linkfrom ON link (linkfrom);
  43  CREATE INDEX linkto ON link (linkto);
  44  
  45  CREATE TABLE session (
  46          sess_id     CHAR(32) NOT NULL DEFAULT '',
  47          sess_data     BLOB NOT NULL,
  48          sess_date     INT UNSIGNED NOT NULL,
  49          sess_ip     CHAR(40) NOT NULL,
  50          PRIMARY KEY (sess_id)
  51  );
  52  CREATE INDEX sessdate_index ON session (sess_date);
  53  CREATE INDEX sessip_index ON session (sess_ip);
  54  
  55  -- Optional DB Auth and Prefs
  56  -- For these tables below the default table prefix must be used 
  57  -- in the DBAuthParam SQL statements also.
  58  
  59  CREATE TABLE pref (
  60        userid     CHAR(48) NOT NULL,
  61        prefs      TEXT NULL DEFAULT '',
  62        passwd     CHAR(48) DEFAULT '',
  63      groupname CHAR(48) DEFAULT 'users',
  64          PRIMARY KEY (userid)
  65  );
  66  
  67  -- update to 1.3.12: (see lib/upgrade.php)
  68  -- ALTER TABLE pref ADD passwd     CHAR(48) BINARY DEFAULT '';
  69  -- ALTER TABLE pref ADD groupname CHAR(48) BINARY DEFAULT 'users';
  70  
  71  -- deprecated since 1.3.12. only useful for seperate databases.
  72  -- better use the extra pref table where such users can be created easily 
  73  -- without password.
  74  --CREATE TABLE user (
  75  --      userid     CHAR(48) NOT NULL,
  76  --      passwd     CHAR(48) DEFAULT '',
  77  --    prefs      TEXT NULL DEFAULT '',
  78  --    groupname CHAR(48) DEFAULT 'users'
  79  --);
  80  
  81  -- Use the member table, if you need it for n:m user-group relations,
  82  -- and adjust your DBAUTH_AUTH_ SQL statements.
  83  CREATE TABLE member (
  84      userid    CHAR(48) NOT NULL,
  85         groupname CHAR(48) NOT NULL DEFAULT 'users'
  86  );
  87  CREATE INDEX member_userid ON member (userid);
  88  CREATE INDEX member_groupname ON member (groupname);
  89  
  90  -- only if you plan to use the wikilens theme
  91  CREATE TABLE rating (
  92          dimension INT(4) NOT NULL,
  93          raterpage INT(11) NOT NULL,
  94          rateepage INT(11) NOT NULL,
  95          ratingvalue FLOAT NOT NULL,
  96          rateeversion INT(11) NOT NULL,
  97          tstamp TIMESTAMP(14) NOT NULL,
  98          PRIMARY KEY (dimension, raterpage, rateepage)
  99  );
 100  CREATE INDEX rating_dimension ON rating (dimension);
 101  CREATE INDEX rating_raterpage ON rating (raterpage);
 102  CREATE INDEX rating_rateepage ON rating (rateepage);
 103  
 104  -- if ACCESS_LOG_SQL > 0
 105  -- only if you need fast log-analysis (spam prevention, recent referrers)
 106  -- see http://www.outoforder.cc/projects/apache/mod_log_sql/docs-2.0/#id2756178
 107  CREATE TABLE accesslog (
 108          time_stamp    INT UNSIGNED,
 109      remote_host   VARCHAR(100),
 110      remote_user   VARCHAR(50),
 111          request_method VARCHAR(10),
 112      request_line  VARCHAR(255),
 113      request_args  VARCHAR(255),
 114      request_file  VARCHAR(255),
 115      request_uri   VARCHAR(255),
 116      request_time  CHAR(28),
 117      status           SMALLINT UNSIGNED,
 118      bytes_sent    SMALLINT UNSIGNED,
 119          referer       VARCHAR(255), 
 120      agent         VARCHAR(255),
 121      request_duration FLOAT
 122  );
 123  CREATE INDEX log_time ON accesslog (time_stamp);
 124  CREATE INDEX log_host ON accesslog (remote_host);
 125  -- create extra indices on demand (usually referer. see plugin/AccessLogSql)

title

Description

title

Description

title

Description

title

title

Body