install/schemas/mysql_stage2.sql
changeset 398 7aa9370830f8
parent 384 42522b5bb227
child 401 6ae6e387a0e3
equal deleted inserted replaced
397:06415d243d09 398:7aa9370830f8
    31 ) CHARACTER SET `utf8` COLLATE `utf8_bin`;
    31 ) CHARACTER SET `utf8` COLLATE `utf8_bin`;
    32 
    32 
    33 CREATE TABLE {{TABLE_PREFIX}}logs(
    33 CREATE TABLE {{TABLE_PREFIX}}logs(
    34   log_type varchar(16),
    34   log_type varchar(16),
    35   action varchar(16),
    35   action varchar(16),
    36   time_id int(12) NOT NULL default '0',
    36   time_id int(12) NOT NULL DEFAULT '0',
    37   date_string varchar(63),
    37   date_string varchar(63),
    38   page_id text,
    38   page_id text,
    39   namespace text,
    39   namespace text,
    40   page_text text,
    40   page_text text,
    41   char_tag varchar(40),
    41   char_tag varchar(40),
    44   minor_edit tinyint(1)
    44   minor_edit tinyint(1)
    45 ) CHARACTER SET `utf8` COLLATE `utf8_bin`;
    45 ) CHARACTER SET `utf8` COLLATE `utf8_bin`;
    46 
    46 
    47 CREATE TABLE {{TABLE_PREFIX}}page_text(
    47 CREATE TABLE {{TABLE_PREFIX}}page_text(
    48   page_id varchar(255),
    48   page_id varchar(255),
    49   namespace varchar(16) NOT NULL default 'Article',
    49   namespace varchar(16) NOT NULL DEFAULT 'Article',
    50   page_text text,
    50   page_text text,
    51   char_tag varchar(63),
    51   char_tag varchar(63),
    52   FULLTEXT KEY {{TABLE_PREFIX}}page_search_idx (page_id, namespace, page_text)
    52   FULLTEXT KEY {{TABLE_PREFIX}}page_search_idx (page_id, namespace, page_text)
    53 ) ENGINE = MYISAM CHARACTER SET `utf8`;
    53 ) ENGINE = MYISAM CHARACTER SET `utf8`;
    54 
    54 
    55 CREATE TABLE {{TABLE_PREFIX}}pages(
    55 CREATE TABLE {{TABLE_PREFIX}}pages(
    56   page_order int(8),
    56   page_order int(8),
    57   name varchar(255),
    57   name varchar(255),
    58   urlname varchar(255),
    58   urlname varchar(255),
    59   namespace varchar(16) NOT NULL default 'Article',
    59   namespace varchar(16) NOT NULL DEFAULT 'Article',
    60   special tinyint(1) default '0',
    60   special tinyint(1) default '0',
    61   visible tinyint(1) default '1',
    61   visible tinyint(1) default '1',
    62   comments_on tinyint(1) default '1',
    62   comments_on tinyint(1) default '1',
    63   protected tinyint(1) NOT NULL DEFAULT 0,
    63   protected tinyint(1) NOT NULL DEFAULT 0,
    64   wiki_mode tinyint(1) NOT NULL DEFAULT 2,
    64   wiki_mode tinyint(1) NOT NULL DEFAULT 2,
    65   delvotes int(10) NOT NULL default 0,
    65   delvotes int(10) NOT NULL DEFAULT 0,
    66   password varchar(40) NOT NULL DEFAULT '',
    66   password varchar(40) NOT NULL DEFAULT '',
    67   delvote_ips text DEFAULT NULL
    67   delvote_ips text DEFAULT NULL
    68 ) CHARACTER SET `utf8` COLLATE `utf8_bin`;
    68 ) CHARACTER SET `utf8` COLLATE `utf8_bin`;
    69 
    69 
    70 CREATE TABLE {{TABLE_PREFIX}}session_keys(
    70 CREATE TABLE {{TABLE_PREFIX}}session_keys(
    71   session_key varchar(32),
    71   session_key varchar(32),
    72   salt varchar(32),
    72   salt varchar(32),
    73   user_id mediumint(8),
    73   user_id mediumint(8),
    74   auth_level tinyint(1) NOT NULL default '0',
    74   auth_level tinyint(1) NOT NULL DEFAULT '0',
    75   source_ip varchar(10) default '0x7f000001',
    75   source_ip varchar(10) default '0x7f000001',
    76   time bigint(15) default '0'
    76   time bigint(15) default '0'
    77 ) CHARACTER SET `utf8` COLLATE `utf8_bin`;
    77 ) CHARACTER SET `utf8` COLLATE `utf8_bin`;
    78 
    78 
    79 CREATE TABLE {{TABLE_PREFIX}}themes(
    79 CREATE TABLE {{TABLE_PREFIX}}themes(
    80   theme_id varchar(63),
    80   theme_id varchar(63),
    81   theme_name text,
    81   theme_name text,
    82   theme_order smallint(5) NOT NULL default '1',
    82   theme_order smallint(5) NOT NULL DEFAULT '1',
    83   default_style varchar(63) NOT NULL DEFAULT '',
    83   default_style varchar(63) NOT NULL DEFAULT '',
    84   enabled tinyint(1) NOT NULL default '1'
    84   enabled tinyint(1) NOT NULL DEFAULT '1'
    85 ) CHARACTER SET `utf8` COLLATE `utf8_bin`;
    85 ) CHARACTER SET `utf8` COLLATE `utf8_bin`;
    86 
    86 
    87 CREATE TABLE {{TABLE_PREFIX}}users(
    87 CREATE TABLE {{TABLE_PREFIX}}users(
    88   user_id mediumint(8) NOT NULL auto_increment,
    88   user_id mediumint(8) NOT NULL auto_increment,
    89   username text,
    89   username text,
    90   password varchar(255),
    90   password varchar(255),
    91   email text,
    91   email text,
    92   real_name text,
    92   real_name text,
    93   user_level tinyint(1) NOT NULL default 2,
    93   user_level tinyint(1) NOT NULL DEFAULT 2,
    94   theme varchar(64) NOT NULL default 'bleu.css',
    94   theme varchar(64) NOT NULL DEFAULT 'bleu.css',
    95   style varchar(64) NOT NULL default 'default',
    95   style varchar(64) NOT NULL DEFAULT 'default',
    96   signature text,
    96   signature text,
    97   reg_time int(11) NOT NULL DEFAULT 0,
    97   reg_time int(11) NOT NULL DEFAULT 0,
    98   account_active tinyint(1) NOT NULL DEFAULT 0,
    98   account_active tinyint(1) NOT NULL DEFAULT 0,
    99   activation_key varchar(40) NOT NULL DEFAULT 0,
    99   activation_key varchar(40) NOT NULL DEFAULT 0,
   100   old_encryption tinyint(1) NOT NULL DEFAULT 0,
   100   old_encryption tinyint(1) NOT NULL DEFAULT 0,
   101   temp_password text,
   101   temp_password text,
   102   temp_password_time int(12) NOT NULL DEFAULT 0,
   102   temp_password_time int(12) NOT NULL DEFAULT 0,
   103   user_coppa tinyint(1) NOT NULL DEFAULT 0,
   103   user_coppa tinyint(1) NOT NULL DEFAULT 0,
   104   user_lang smallint(5) NOT NULL,
   104   user_lang smallint(5) NOT NULL DEFAULT 1,
   105   user_has_avatar tinyint(1) NOT NULL,
   105   user_has_avatar tinyint(1) NOT NULL DEFAULT 0,
   106   avatar_type ENUM('jpg', 'png', 'gif') NOT NULL,
   106   avatar_type ENUM('jpg', 'png', 'gif') NOT NULL DEFAULT 'png',
   107   user_registration_ip varchar(39),
   107   user_registration_ip varchar(39),
   108   PRIMARY KEY  (user_id)
   108   PRIMARY KEY  (user_id)
   109 ) CHARACTER SET `utf8` COLLATE `utf8_bin`;
   109 ) CHARACTER SET `utf8` COLLATE `utf8_bin`;
   110 
   110 
   111 CREATE TABLE {{TABLE_PREFIX}}users_extra(
   111 CREATE TABLE {{TABLE_PREFIX}}users_extra(
   145 
   145 
   146 CREATE TABLE {{TABLE_PREFIX}}buddies(
   146 CREATE TABLE {{TABLE_PREFIX}}buddies(
   147   buddy_id int(15) NOT NULL auto_increment,
   147   buddy_id int(15) NOT NULL auto_increment,
   148   user_id mediumint(8),
   148   user_id mediumint(8),
   149   buddy_user_id mediumint(8),
   149   buddy_user_id mediumint(8),
   150   is_friend tinyint(1) NOT NULL default '1',
   150   is_friend tinyint(1) NOT NULL DEFAULT '1',
   151   PRIMARY KEY  (buddy_id) 
   151   PRIMARY KEY  (buddy_id) 
   152 ) CHARACTER SET `utf8` COLLATE `utf8_bin`;
   152 ) CHARACTER SET `utf8` COLLATE `utf8_bin`;
   153 
   153 
   154 CREATE TABLE {{TABLE_PREFIX}}privmsgs(
   154 CREATE TABLE {{TABLE_PREFIX}}privmsgs(
   155   message_id int(15) NOT NULL auto_increment,
   155   message_id int(15) NOT NULL auto_increment,