install/schemas/postgresql_stage2.sql
changeset 831 45e887f23282
parent 801 eb8b23f11744
child 857 f3a5a276208c
equal deleted inserted replaced
830:79fb483807f6 831:45e887f23282
     9 -- warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for details.
     9 -- warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for details.
    10 
    10 
    11 -- postgresql_stage2.sql - PostgreSQL installation schema, main payload
    11 -- postgresql_stage2.sql - PostgreSQL installation schema, main payload
    12 
    12 
    13 CREATE TABLE {{TABLE_PREFIX}}categories(
    13 CREATE TABLE {{TABLE_PREFIX}}categories(
    14   page_id varchar(64),
    14   page_id varchar(512),
    15   namespace varchar(64),
    15   namespace varchar(16),
    16   category_id varchar(64)
    16   category_id varchar(64)
    17 );
    17 );
    18 
    18 
    19 CREATE TABLE {{TABLE_PREFIX}}comments(
    19 CREATE TABLE {{TABLE_PREFIX}}comments(
    20   comment_id SERIAL,
    20   comment_id SERIAL,
    21   page_id text,
    21   page_id varchar(512),
    22   namespace text,
    22   namespace varchar(16),
    23   subject text,
    23   subject text,
    24   comment_data text,
    24   comment_data text,
    25   name text,
    25   name text,
    26   approved smallint DEFAULT 1,
    26   approved smallint DEFAULT 1,
    27   user_id int NOT NULL DEFAULT -1,
    27   user_id int NOT NULL DEFAULT -1,
    34   log_id SERIAL,
    34   log_id SERIAL,
    35   log_type varchar(16),
    35   log_type varchar(16),
    36   action varchar(16),
    36   action varchar(16),
    37   time_id int NOT NULL DEFAULT '0',
    37   time_id int NOT NULL DEFAULT '0',
    38   date_string varchar(63),
    38   date_string varchar(63),
    39   page_id text,
    39   page_id varchar(512),
    40   namespace text,
    40   namespace varchar(16),
    41   page_text text,
    41   page_text text,
    42   char_tag varchar(40),
    42   char_tag varchar(40),
    43   author varchar(63),
    43   author varchar(63),
    44   edit_summary text,
    44   edit_summary text,
    45   minor_edit smallint,
    45   minor_edit smallint,
    46   is_draft smallint NOT NULL DEFAULT 0,
    46   is_draft smallint NOT NULL DEFAULT 0,
    47   PRIMARY KEY ( log_id )
    47   PRIMARY KEY ( log_id )
    48 );
    48 );
    49 
    49 
    50 CREATE TABLE {{TABLE_PREFIX}}page_text(
    50 CREATE TABLE {{TABLE_PREFIX}}page_text(
    51   page_id varchar(255),
    51   page_id varchar(512),
    52   namespace varchar(16) NOT NULL DEFAULT 'Article',
    52   namespace varchar(16) NOT NULL DEFAULT 'Article',
    53   page_text text,
    53   page_text text,
    54   char_tag varchar(63)
    54   char_tag varchar(63)
    55 );
    55 );
    56 
    56 
    60   urlname varchar(255),
    60   urlname varchar(255),
    61   namespace varchar(16) NOT NULL DEFAULT 'Article',
    61   namespace varchar(16) NOT NULL DEFAULT 'Article',
    62   special smallint DEFAULT '0',
    62   special smallint DEFAULT '0',
    63   visible smallint DEFAULT '1',
    63   visible smallint DEFAULT '1',
    64   comments_on smallint DEFAULT '1',
    64   comments_on smallint DEFAULT '1',
       
    65   page_format varchar(16) NOT NULL DEFAULT 'wikitext',
    65   protected smallint NOT NULL DEFAULT 0,
    66   protected smallint NOT NULL DEFAULT 0,
    66   wiki_mode smallint NOT NULL DEFAULT 2,
    67   wiki_mode smallint NOT NULL DEFAULT 2,
    67   delvotes int NOT NULL DEFAULT 0,
    68   delvotes int NOT NULL DEFAULT 0,
    68   password varchar(40) NOT NULL DEFAULT '',
    69   password varchar(40) NOT NULL DEFAULT '',
    69   delvote_ips text DEFAULT NULL
    70   delvote_ips text DEFAULT NULL
   147 );
   148 );
   148 
   149 
   149 CREATE TABLE {{TABLE_PREFIX}}files(
   150 CREATE TABLE {{TABLE_PREFIX}}files(
   150   file_id SERIAL,
   151   file_id SERIAL,
   151   time_id int NOT NULL,
   152   time_id int NOT NULL,
   152   page_id varchar(63) NOT NULL,
   153   page_id varchar(512) NOT NULL,
   153   filename varchar(127) DEFAULT NULL,
   154   filename varchar(127) DEFAULT NULL,
   154   size bigint NOT NULL,
   155   size bigint NOT NULL,
   155   mimetype varchar(63) DEFAULT NULL,
   156   mimetype varchar(63) DEFAULT NULL,
   156   file_extension varchar(8) DEFAULT NULL,
   157   file_extension varchar(8) DEFAULT NULL,
   157   file_key varchar(32) NOT NULL,
   158   file_key varchar(32) NOT NULL,
   191 
   192 
   192 CREATE TABLE {{TABLE_PREFIX}}hits(
   193 CREATE TABLE {{TABLE_PREFIX}}hits(
   193   hit_id SERIAL,
   194   hit_id SERIAL,
   194   username varchar(63) NOT NULL,
   195   username varchar(63) NOT NULL,
   195   time int NOT NULL DEFAULT 0,
   196   time int NOT NULL DEFAULT 0,
   196   page_id varchar(63),
   197   page_id varchar(512),
   197   namespace varchar(63),
   198   namespace varchar(16),
   198   PRIMARY KEY ( hit_id ) 
   199   PRIMARY KEY ( hit_id ) 
   199 );
   200 );
   200 
   201 
   201 CREATE TABLE {{TABLE_PREFIX}}search_index(
   202 CREATE TABLE {{TABLE_PREFIX}}search_index(
   202   word varchar(64) NOT NULL,
   203   word varchar(64) NOT NULL,
   225 
   226 
   226 CREATE TABLE {{TABLE_PREFIX}}acl(
   227 CREATE TABLE {{TABLE_PREFIX}}acl(
   227   rule_id SERIAL,
   228   rule_id SERIAL,
   228   target_type smallint NOT NULL,
   229   target_type smallint NOT NULL,
   229   target_id int NOT NULL,
   230   target_id int NOT NULL,
   230   page_id varchar(255),
   231   page_id varchar(512),
   231   namespace varchar(24),
   232   namespace varchar(16),
   232   rules text,
   233   rules text,
   233   PRIMARY KEY ( rule_id ) 
   234   PRIMARY KEY ( rule_id ) 
   234 );
   235 );
   235 
   236 
   236 -- Added in 1.0.1
   237 -- Added in 1.0.1
   246 -- Added in 1.0.1
   247 -- Added in 1.0.1
   247 
   248 
   248 CREATE TABLE {{TABLE_PREFIX}}page_group_members(
   249 CREATE TABLE {{TABLE_PREFIX}}page_group_members(
   249   pg_member_id SERIAL,
   250   pg_member_id SERIAL,
   250   pg_id int NOT NULL,
   251   pg_id int NOT NULL,
   251   page_id varchar(63) NOT NULL,
   252   page_id varchar(512) NOT NULL,
   252   namespace varchar(63) NOT NULL DEFAULT 'Article',
   253   namespace varchar(16) NOT NULL DEFAULT 'Article',
   253   PRIMARY KEY ( pg_member_id )
   254   PRIMARY KEY ( pg_member_id )
   254 );
   255 );
   255 
   256 
   256 -- Added in 1.0.1
   257 -- Added in 1.0.1
   257 
   258 
   258 CREATE TABLE {{TABLE_PREFIX}}tags(
   259 CREATE TABLE {{TABLE_PREFIX}}tags(
   259   tag_id SERIAL,
   260   tag_id SERIAL,
   260   tag_name varchar(63) NOT NULL DEFAULT 'bla',
   261   tag_name varchar(63) NOT NULL DEFAULT 'bla',
   261   page_id varchar(255) NOT NULL,
   262   page_id varchar(512) NOT NULL,
   262   namespace varchar(255) NOT NULL,
   263   namespace varchar(16) NOT NULL,
   263   user_id int NOT NULL DEFAULT 1,
   264   user_id int NOT NULL DEFAULT 1,
   264   PRIMARY KEY ( tag_id )
   265   PRIMARY KEY ( tag_id )
   265 );
   266 );
   266 
   267 
   267 -- Added in 1.1.1
   268 -- Added in 1.1.1