install/schemas/upgrade/1.1.1-1.1.2-postgresql.sql
changeset 1259 49db7495f6b8
parent 1258 d972b1276d95
child 1260 cd72bcd83401
equal deleted inserted replaced
1258:d972b1276d95 1259:49db7495f6b8
     1 -- Enano CMS
       
     2 -- Upgrade schema - Enano 1.1.1 - 1.1.2
       
     3 
       
     4 ALTER TABLE {{TABLE_PREFIX}}logs ADD COLUMN log_id SERIAL, ADD PRIMARY KEY ( log_id );
       
     5 ALTER TABLE {{TABLE_PREFIX}}logs ADD COLUMN is_draft smallint NOT NULL DEFAULT 0;
       
     6 
       
     7 ALTER TABLE {{TABLE_PREFIX}}users ADD COLUMN user_rank int NOT NULL DEFAULT 1;
       
     8 @ALTER TABLE {{TABLE_PREFIX}}users DROP user_timezone;
       
     9 ALTER TABLE {{TABLE_PREFIX}}users ADD COLUMN user_timezone int NOT NULL DEFAULT 1440;
       
    10 
       
    11 ALTER TABLE {{TABLE_PREFIX}}themes
       
    12   ADD COLUMN group_list text DEFAULT NULL,
       
    13   ADD COLUMN group_policy varchar(5) NOT NULL DEFAULT 'deny',
       
    14   ADD CHECK (group_policy IN ('allow', 'deny'));
       
    15 
       
    16 CREATE TABLE {{TABLE_PREFIX}}ranks(
       
    17   rank_id SERIAL,
       
    18   rank_title varchar(63) NOT NULL DEFAULT '',
       
    19   rank_style varchar(255) NOT NULL DEFAULT '',
       
    20   PRIMARY KEY ( rank_id )
       
    21 );
       
    22 
       
    23 CREATE TABLE {{TABLE_PREFIX}}captcha(
       
    24   code_id SERIAL,
       
    25   session_id varchar(40) NOT NULL DEFAULT '',
       
    26   code varchar(64) NOT NULL DEFAULT '',
       
    27   session_data text,
       
    28   source_ip varchar(39),
       
    29   user_id int,
       
    30   PRIMARY KEY ( code_id )
       
    31 );
       
    32 
       
    33 INSERT INTO {{TABLE_PREFIX}}ranks(rank_id, rank_title, rank_style) VALUES
       
    34   (1, 'user_rank_member', ''),
       
    35   (2, 'user_rank_mod', 'font-weight: bold; color: #00AA00;'),
       
    36   (3, 'user_rank_admin', 'font-weight: bold; color: #AA0000;');
       
    37 
       
    38 -- For some reason this is required, it came up in my QA testing on a2hosting
       
    39 SELECT NEXTVAL('{{TABLE_PREFIX}}ranks_rank_id_seq'::regclass);
       
    40