author | Dan Fuhry <dan@enanocms.org> |
Thu, 28 Oct 2010 03:32:57 -0400 | |
changeset 1309 | 2a14b5a25338 |
parent 1259 | 49db7495f6b8 |
permissions | -rw-r--r-- |
1259
49db7495f6b8
First shot at switching to database revision numbers separate from release version number. There are probably bugs, especially related to migration.
Dan Fuhry <dan@enanocms.org>
parents:
diff
changeset
|
1 |
-- Enano CMS |
49db7495f6b8
First shot at switching to database revision numbers separate from release version number. There are probably bugs, especially related to migration.
Dan Fuhry <dan@enanocms.org>
parents:
diff
changeset
|
2 |
-- Upgrade schema - Enano 1.1.1 - 1.1.2 |
49db7495f6b8
First shot at switching to database revision numbers separate from release version number. There are probably bugs, especially related to migration.
Dan Fuhry <dan@enanocms.org>
parents:
diff
changeset
|
3 |
|
49db7495f6b8
First shot at switching to database revision numbers separate from release version number. There are probably bugs, especially related to migration.
Dan Fuhry <dan@enanocms.org>
parents:
diff
changeset
|
4 |
ALTER TABLE {{TABLE_PREFIX}}logs ADD COLUMN log_id SERIAL, ADD PRIMARY KEY ( log_id ); |
49db7495f6b8
First shot at switching to database revision numbers separate from release version number. There are probably bugs, especially related to migration.
Dan Fuhry <dan@enanocms.org>
parents:
diff
changeset
|
5 |
ALTER TABLE {{TABLE_PREFIX}}logs ADD COLUMN is_draft smallint NOT NULL DEFAULT 0; |
49db7495f6b8
First shot at switching to database revision numbers separate from release version number. There are probably bugs, especially related to migration.
Dan Fuhry <dan@enanocms.org>
parents:
diff
changeset
|
6 |
|
49db7495f6b8
First shot at switching to database revision numbers separate from release version number. There are probably bugs, especially related to migration.
Dan Fuhry <dan@enanocms.org>
parents:
diff
changeset
|
7 |
ALTER TABLE {{TABLE_PREFIX}}users ADD COLUMN user_rank int NOT NULL DEFAULT 1; |
49db7495f6b8
First shot at switching to database revision numbers separate from release version number. There are probably bugs, especially related to migration.
Dan Fuhry <dan@enanocms.org>
parents:
diff
changeset
|
8 |
@ALTER TABLE {{TABLE_PREFIX}}users DROP user_timezone; |
49db7495f6b8
First shot at switching to database revision numbers separate from release version number. There are probably bugs, especially related to migration.
Dan Fuhry <dan@enanocms.org>
parents:
diff
changeset
|
9 |
ALTER TABLE {{TABLE_PREFIX}}users ADD COLUMN user_timezone int NOT NULL DEFAULT 1440; |
49db7495f6b8
First shot at switching to database revision numbers separate from release version number. There are probably bugs, especially related to migration.
Dan Fuhry <dan@enanocms.org>
parents:
diff
changeset
|
10 |
|
49db7495f6b8
First shot at switching to database revision numbers separate from release version number. There are probably bugs, especially related to migration.
Dan Fuhry <dan@enanocms.org>
parents:
diff
changeset
|
11 |
ALTER TABLE {{TABLE_PREFIX}}themes |
49db7495f6b8
First shot at switching to database revision numbers separate from release version number. There are probably bugs, especially related to migration.
Dan Fuhry <dan@enanocms.org>
parents:
diff
changeset
|
12 |
ADD COLUMN group_list text DEFAULT NULL, |
49db7495f6b8
First shot at switching to database revision numbers separate from release version number. There are probably bugs, especially related to migration.
Dan Fuhry <dan@enanocms.org>
parents:
diff
changeset
|
13 |
ADD COLUMN group_policy varchar(5) NOT NULL DEFAULT 'deny', |
49db7495f6b8
First shot at switching to database revision numbers separate from release version number. There are probably bugs, especially related to migration.
Dan Fuhry <dan@enanocms.org>
parents:
diff
changeset
|
14 |
ADD CHECK (group_policy IN ('allow', 'deny')); |
49db7495f6b8
First shot at switching to database revision numbers separate from release version number. There are probably bugs, especially related to migration.
Dan Fuhry <dan@enanocms.org>
parents:
diff
changeset
|
15 |
|
49db7495f6b8
First shot at switching to database revision numbers separate from release version number. There are probably bugs, especially related to migration.
Dan Fuhry <dan@enanocms.org>
parents:
diff
changeset
|
16 |
CREATE TABLE {{TABLE_PREFIX}}ranks( |
49db7495f6b8
First shot at switching to database revision numbers separate from release version number. There are probably bugs, especially related to migration.
Dan Fuhry <dan@enanocms.org>
parents:
diff
changeset
|
17 |
rank_id SERIAL, |
49db7495f6b8
First shot at switching to database revision numbers separate from release version number. There are probably bugs, especially related to migration.
Dan Fuhry <dan@enanocms.org>
parents:
diff
changeset
|
18 |
rank_title varchar(63) NOT NULL DEFAULT '', |
49db7495f6b8
First shot at switching to database revision numbers separate from release version number. There are probably bugs, especially related to migration.
Dan Fuhry <dan@enanocms.org>
parents:
diff
changeset
|
19 |
rank_style varchar(255) NOT NULL DEFAULT '', |
49db7495f6b8
First shot at switching to database revision numbers separate from release version number. There are probably bugs, especially related to migration.
Dan Fuhry <dan@enanocms.org>
parents:
diff
changeset
|
20 |
PRIMARY KEY ( rank_id ) |
49db7495f6b8
First shot at switching to database revision numbers separate from release version number. There are probably bugs, especially related to migration.
Dan Fuhry <dan@enanocms.org>
parents:
diff
changeset
|
21 |
); |
49db7495f6b8
First shot at switching to database revision numbers separate from release version number. There are probably bugs, especially related to migration.
Dan Fuhry <dan@enanocms.org>
parents:
diff
changeset
|
22 |
|
49db7495f6b8
First shot at switching to database revision numbers separate from release version number. There are probably bugs, especially related to migration.
Dan Fuhry <dan@enanocms.org>
parents:
diff
changeset
|
23 |
CREATE TABLE {{TABLE_PREFIX}}captcha( |
49db7495f6b8
First shot at switching to database revision numbers separate from release version number. There are probably bugs, especially related to migration.
Dan Fuhry <dan@enanocms.org>
parents:
diff
changeset
|
24 |
code_id SERIAL, |
49db7495f6b8
First shot at switching to database revision numbers separate from release version number. There are probably bugs, especially related to migration.
Dan Fuhry <dan@enanocms.org>
parents:
diff
changeset
|
25 |
session_id varchar(40) NOT NULL DEFAULT '', |
49db7495f6b8
First shot at switching to database revision numbers separate from release version number. There are probably bugs, especially related to migration.
Dan Fuhry <dan@enanocms.org>
parents:
diff
changeset
|
26 |
code varchar(64) NOT NULL DEFAULT '', |
49db7495f6b8
First shot at switching to database revision numbers separate from release version number. There are probably bugs, especially related to migration.
Dan Fuhry <dan@enanocms.org>
parents:
diff
changeset
|
27 |
session_data text, |
49db7495f6b8
First shot at switching to database revision numbers separate from release version number. There are probably bugs, especially related to migration.
Dan Fuhry <dan@enanocms.org>
parents:
diff
changeset
|
28 |
source_ip varchar(39), |
49db7495f6b8
First shot at switching to database revision numbers separate from release version number. There are probably bugs, especially related to migration.
Dan Fuhry <dan@enanocms.org>
parents:
diff
changeset
|
29 |
user_id int, |
49db7495f6b8
First shot at switching to database revision numbers separate from release version number. There are probably bugs, especially related to migration.
Dan Fuhry <dan@enanocms.org>
parents:
diff
changeset
|
30 |
PRIMARY KEY ( code_id ) |
49db7495f6b8
First shot at switching to database revision numbers separate from release version number. There are probably bugs, especially related to migration.
Dan Fuhry <dan@enanocms.org>
parents:
diff
changeset
|
31 |
); |
49db7495f6b8
First shot at switching to database revision numbers separate from release version number. There are probably bugs, especially related to migration.
Dan Fuhry <dan@enanocms.org>
parents:
diff
changeset
|
32 |
|
49db7495f6b8
First shot at switching to database revision numbers separate from release version number. There are probably bugs, especially related to migration.
Dan Fuhry <dan@enanocms.org>
parents:
diff
changeset
|
33 |
INSERT INTO {{TABLE_PREFIX}}ranks(rank_id, rank_title, rank_style) VALUES |
49db7495f6b8
First shot at switching to database revision numbers separate from release version number. There are probably bugs, especially related to migration.
Dan Fuhry <dan@enanocms.org>
parents:
diff
changeset
|
34 |
(1, 'user_rank_member', ''), |
49db7495f6b8
First shot at switching to database revision numbers separate from release version number. There are probably bugs, especially related to migration.
Dan Fuhry <dan@enanocms.org>
parents:
diff
changeset
|
35 |
(2, 'user_rank_mod', 'font-weight: bold; color: #00AA00;'), |
49db7495f6b8
First shot at switching to database revision numbers separate from release version number. There are probably bugs, especially related to migration.
Dan Fuhry <dan@enanocms.org>
parents:
diff
changeset
|
36 |
(3, 'user_rank_admin', 'font-weight: bold; color: #AA0000;'); |
49db7495f6b8
First shot at switching to database revision numbers separate from release version number. There are probably bugs, especially related to migration.
Dan Fuhry <dan@enanocms.org>
parents:
diff
changeset
|
37 |
|
49db7495f6b8
First shot at switching to database revision numbers separate from release version number. There are probably bugs, especially related to migration.
Dan Fuhry <dan@enanocms.org>
parents:
diff
changeset
|
38 |
-- For some reason this is required, it came up in my QA testing on a2hosting |
49db7495f6b8
First shot at switching to database revision numbers separate from release version number. There are probably bugs, especially related to migration.
Dan Fuhry <dan@enanocms.org>
parents:
diff
changeset
|
39 |
SELECT NEXTVAL('{{TABLE_PREFIX}}ranks_rank_id_seq'::regclass); |
49db7495f6b8
First shot at switching to database revision numbers separate from release version number. There are probably bugs, especially related to migration.
Dan Fuhry <dan@enanocms.org>
parents:
diff
changeset
|
40 |