install/schemas/postgresql_stage2.sql
changeset 665 af7e8ec6aef7
parent 636 c9ea830a211f
child 685 17ebe24cdf85
equal deleted inserted replaced
664:b164e05c5faa 665:af7e8ec6aef7
   265 CREATE TABLE {{TABLE_PREFIX}}lockout(
   265 CREATE TABLE {{TABLE_PREFIX}}lockout(
   266   id SERIAL,
   266   id SERIAL,
   267   ipaddr varchar(40) NOT NULL,
   267   ipaddr varchar(40) NOT NULL,
   268   action varchar(20) NOT NULL DEFAULT 'credential',
   268   action varchar(20) NOT NULL DEFAULT 'credential',
   269   timestamp int NOT NULL DEFAULT 0,
   269   timestamp int NOT NULL DEFAULT 0,
   270   CHECK ( action IN ('credential', 'level') )
   270   CHECK ( action IN ('credential', 'level') ),
       
   271   PRIMARY KEY ( id )
   271 );
   272 );
   272 
   273 
   273 -- Added in 1.1.1
   274 -- Added in 1.1.1
   274 
   275 
   275 CREATE TABLE {{TABLE_PREFIX}}language(
   276 CREATE TABLE {{TABLE_PREFIX}}language(
   276   lang_id SERIAL,
   277   lang_id SERIAL,
   277   lang_code varchar(16) NOT NULL,
   278   lang_code varchar(16) NOT NULL,
   278   lang_name_DEFAULT varchar(64) NOT NULL,
   279   lang_name_DEFAULT varchar(64) NOT NULL,
   279   lang_name_native varchar(64) NOT NULL,
   280   lang_name_native varchar(64) NOT NULL,
   280   last_changed int NOT NULL DEFAULT 0
   281   last_changed int NOT NULL DEFAULT 0,
       
   282   PRIMARY KEY ( lang_id )
   281 );
   283 );
   282 
   284 
   283 -- Added in 1.1.1
   285 -- Added in 1.1.1
   284 
   286 
   285 CREATE TABLE {{TABLE_PREFIX}}language_strings(
   287 CREATE TABLE {{TABLE_PREFIX}}language_strings(
   286   string_id SERIAL,
   288   string_id SERIAL,
   287   lang_id int NOT NULL,
   289   lang_id int NOT NULL,
   288   string_category varchar(32) NOT NULL,
   290   string_category varchar(32) NOT NULL,
   289   string_name varchar(64) NOT NULL,
   291   string_name varchar(64) NOT NULL,
   290   string_content text NOT NULL
   292   string_content text NOT NULL,
       
   293   PRIMARY KEY ( string_id )
   291 );
   294 );
   292 
   295 
   293 -- Added in 1.1.1
   296 -- Added in 1.1.1
   294 
   297 
   295 CREATE TABLE {{TABLE_PREFIX}}ranks(
   298 CREATE TABLE {{TABLE_PREFIX}}ranks(
   296   rank_id SERIAL,
   299   rank_id SERIAL,
   297   rank_title varchar(63) NOT NULL DEFAULT '',
   300   rank_title varchar(63) NOT NULL DEFAULT '',
   298   rank_style varchar(255) NOT NULL DEFAULT ''
   301   rank_style varchar(255) NOT NULL DEFAULT '',
       
   302   PRIMARY KEY ( rank_id )
   299 );
   303 );
   300 
   304 
   301 -- Added in 1.1.1
   305 -- Added in 1.1.1
   302 
   306 
   303 CREATE TABLE {{TABLE_PREFIX}}captcha(
   307 CREATE TABLE {{TABLE_PREFIX}}captcha(
   304   code_id SERIAL,
   308   code_id SERIAL,
   305   session_id varchar(40) NOT NULL DEFAULT '',
   309   session_id varchar(40) NOT NULL DEFAULT '',
   306   code varchar(64) NOT NULL DEFAULT '',
   310   code varchar(64) NOT NULL DEFAULT '',
   307   session_data text,
   311   session_data text,
   308   source_ip varchar(39),
   312   source_ip varchar(39),
   309   user_id int
   313   user_id int,
       
   314   PRIMARY KEY ( code_id )
   310 );
   315 );
   311 
   316 
   312 -- Added in 1.1.3
   317 -- Added in 1.1.3
   313 -- Storing obscenely huge integers as strings since that's how php processes them.
   318 -- Storing obscenely huge integers as strings since that's how php processes them.
   314 
   319 
   388   
   393   
   389 INSERT INTO {{TABLE_PREFIX}}users_extra(user_id) VALUES
   394 INSERT INTO {{TABLE_PREFIX}}users_extra(user_id) VALUES
   390   (2);
   395   (2);
   391   
   396   
   392 INSERT INTO {{TABLE_PREFIX}}ranks(rank_title, rank_style) VALUES
   397 INSERT INTO {{TABLE_PREFIX}}ranks(rank_title, rank_style) VALUES
   393   ('user_rank_member', ''),
   398   (1, 'user_rank_member', ''),
   394   ('user_rank_mod', 'font-weight: bold; color: #00AA00;'),
   399   (2, 'user_rank_mod', 'font-weight: bold; color: #00AA00;'),
   395   ('user_rank_admin', 'font-weight: bold; color: #AA0000;'),
   400   (3, 'user_rank_admin', 'font-weight: bold; color: #AA0000;'),
   396   ('user_rank_guest', '');
   401   (4, 'user_rank_guest', '');
   397 
   402 
   398 INSERT INTO {{TABLE_PREFIX}}groups(group_id,group_name,group_type,system_group) VALUES(1, 'Everyone', 3, 1),
   403 INSERT INTO {{TABLE_PREFIX}}groups(group_id,group_name,group_type,system_group) VALUES(1, 'Everyone', 3, 1),
   399   (2,'Administrators',3,1),
   404   (2,'Administrators',3,1),
   400   (3,'Moderators',3,1);
   405   (3,'Moderators',3,1);
   401 
   406