install/schemas/postgresql_stage2.sql
changeset 541 acb7e23b6ffa
parent 519 94214ec0871c
child 555 ac4c6a7f01d8
equal deleted inserted replaced
540:1e4b759da336 541:acb7e23b6ffa
   108   user_coppa smallint NOT NULL DEFAULT 0,
   108   user_coppa smallint NOT NULL DEFAULT 0,
   109   user_lang smallint NOT NULL,
   109   user_lang smallint NOT NULL,
   110   user_has_avatar smallint NOT NULL,
   110   user_has_avatar smallint NOT NULL,
   111   avatar_type varchar(3) NOT NULL,
   111   avatar_type varchar(3) NOT NULL,
   112   user_registration_ip varchar(39),
   112   user_registration_ip varchar(39),
   113   user_rank int NOT NULL DEFAULT 1,
   113   user_rank int DEFAULT NULL,
   114   user_timezone int NOT NULL DEFAULT 0,
   114   user_timezone int NOT NULL DEFAULT 0,
       
   115   user_title varchar(64) DEFAULT NULL,
       
   116   user_group int NOT NULL DEFAULT 1,
   115   CHECK (avatar_type IN ('jpg', 'png', 'gif')),
   117   CHECK (avatar_type IN ('jpg', 'png', 'gif')),
   116   PRIMARY KEY  (user_id)
   118   PRIMARY KEY  (user_id)
   117 );
   119 );
   118 
   120 
   119 CREATE TABLE {{TABLE_PREFIX}}users_extra(
   121 CREATE TABLE {{TABLE_PREFIX}}users_extra(
   323   plugin_filename varchar(63),
   325   plugin_filename varchar(63),
   324   plugin_flags int,
   326   plugin_flags int,
   325   plugin_version varchar(16),
   327   plugin_version varchar(16),
   326   PRIMARY KEY ( plugin_id )
   328   PRIMARY KEY ( plugin_id )
   327 );
   329 );
       
   330 
       
   331 -- Aggregate function array_accum
       
   332 -- http://www.postgresql.org/docs/current/static/xaggr.html
       
   333 
       
   334 CREATE AGGREGATE {{TABLE_PREFIX}}array_accum (anyelement)
       
   335 (
       
   336     sfunc = array_append,
       
   337     stype = anyarray,
       
   338     initcond = '{}'
       
   339 );
       
   340 
   328 
   341 
   329 INSERT INTO {{TABLE_PREFIX}}config(config_name, config_value) VALUES
   342 INSERT INTO {{TABLE_PREFIX}}config(config_name, config_value) VALUES
   330   ('site_name', '{{SITE_NAME}}'),
   343   ('site_name', '{{SITE_NAME}}'),
   331   ('main_page', 'Main_Page'),
   344   ('main_page', 'Main_Page'),
   332   ('site_desc', '{{SITE_DESC}}'),
   345   ('site_desc', '{{SITE_DESC}}'),
   353   ('max_file_size', '256000'),('enano_version', '{{VERSION}}'),( 'allowed_mime_types', 'cbf:len=185;crc=55fb6f14;data=0[1],1[4],0[3],1[1],0[22],1[1],0[16],1[3],0[16],1[1],0[1],1[2],0[6],1[1],0[1],1[1],0[4],1[2],0[3],1[1],0[48],1[2],0[2],1[1],0[4],1[1],0[37]|end' ),
   366   ('max_file_size', '256000'),('enano_version', '{{VERSION}}'),( 'allowed_mime_types', 'cbf:len=185;crc=55fb6f14;data=0[1],1[4],0[3],1[1],0[22],1[1],0[16],1[3],0[16],1[1],0[1],1[2],0[6],1[1],0[1],1[1],0[4],1[2],0[3],1[1],0[48],1[2],0[2],1[1],0[4],1[1],0[37]|end' ),
   354   ('contact_email', '{{ADMIN_EMAIL}}'),
   367   ('contact_email', '{{ADMIN_EMAIL}}'),
   355   ('powered_btn', '1');
   368   ('powered_btn', '1');
   356 
   369 
   357 INSERT INTO {{TABLE_PREFIX}}page_text(page_id, namespace, page_text, char_tag) VALUES
   370 INSERT INTO {{TABLE_PREFIX}}page_text(page_id, namespace, page_text, char_tag) VALUES
   358   ('Main_Page', 'Article', '{{MAIN_PAGE_CONTENT}}', '');
   371   ('Main_Page', 'Article', E'{{MAIN_PAGE_CONTENT}}', '');
   359   
   372   
   360 INSERT INTO {{TABLE_PREFIX}}logs(time_id, date_string, log_type, action, page_id, namespace, author, page_text) VALUES
   373 INSERT INTO {{TABLE_PREFIX}}logs(time_id, date_string, log_type, action, page_id, namespace, author, page_text) VALUES
   361   ({{UNIX_TIME}}, 'DEPRECATED', 'page', 'edit', 'Main_Page', 'Article', '{{ADMIN_USER}}', '{{MAIN_PAGE_CONTENT}}');
   374   ({{UNIX_TIME}}, 'DEPRECATED', 'page', 'edit', 'Main_Page', 'Article', '{{ADMIN_USER}}', '{{MAIN_PAGE_CONTENT}}');
   362 
   375 
   363 INSERT INTO {{TABLE_PREFIX}}pages(page_order, name, urlname, namespace, special, visible, comments_on, protected, delvotes, delvote_ips) VALUES
   376 INSERT INTO {{TABLE_PREFIX}}pages(page_order, name, urlname, namespace, special, visible, comments_on, protected, delvotes, delvote_ips) VALUES
   375   (2);
   388   (2);
   376   
   389   
   377 INSERT INTO {{TABLE_PREFIX}}ranks(rank_id, rank_title, rank_style) VALUES
   390 INSERT INTO {{TABLE_PREFIX}}ranks(rank_id, rank_title, rank_style) VALUES
   378   (1, 'user_rank_member', ''),
   391   (1, 'user_rank_member', ''),
   379   (2, 'user_rank_mod', 'font-weight: bold; color: #00AA00;'),
   392   (2, 'user_rank_mod', 'font-weight: bold; color: #00AA00;'),
   380   (3, 'user_rank_admin', 'font-weight: bold; color: #AA0000;');
   393   (3, 'user_rank_admin', 'font-weight: bold; color: #AA0000;'),
       
   394   (4, 'user_rank_guest', '');
   381 
   395 
   382 INSERT INTO {{TABLE_PREFIX}}groups(group_id,group_name,group_type,system_group) VALUES(1, 'Everyone', 3, 1),
   396 INSERT INTO {{TABLE_PREFIX}}groups(group_id,group_name,group_type,system_group) VALUES(1, 'Everyone', 3, 1),
   383   (2,'Administrators',3,1),
   397   (2,'Administrators',3,1),
   384   (3,'Moderators',3,1);
   398   (3,'Moderators',3,1);
   385 
   399