3 # 1. Write the next db_upgrade_to_X() at the bottom of this file. It will be
4 # called automatically.
6 function db_upgrade_to_1() {
7 db_send_query(<<<EOLsql
8 create table wfpl_sessions (
9 id int unique auto_increment,
10 session_key varchar(16),
18 db_send_query(<<<EOLsql
19 create table email_templates (
20 id int unique auto_increment,
21 slug varchar(200) binary not null default "",
22 notes text binary not null default "",
23 from_addr varchar(100) binary not null default "",
24 to_addr varchar(100) binary not null default "",
25 cc_addr varchar(100) binary not null default "",
26 bcc_addr varchar(100) binary not null default "",
27 subject varchar(200) binary not null default "",
28 content text binary not null default ""
32 db_send_query(<<<EOLsql
34 id int unique auto_increment,
35 filename varchar(100) not null default "",
36 description varchar(200) not null default ""
40 db_send_query(<<<EOLsql
41 create table cms_images (
42 id int unique auto_increment,
43 image varchar(240) not null default "",
44 name varchar(200) not null default "",
45 caption varchar(200) not null default "",
46 created_at int not null default 0
50 db_send_query(<<<EOLsql
51 create table cms_pages (
52 id int unique auto_increment,
53 filename varchar(200) not null default "",
54 title varchar(200) not null default "",
55 nav_title varchar(200) not null default "",
56 navbar int not null default 0,
57 layout int not null default 0,
58 content mediumtext not null default "",
59 sidebar_content mediumtext not null default "",
60 description text not null default "",
61 keywords text not null default ""
65 db_send_query(<<<EOLsql
66 insert into cms_pages set
69 content='Under Construction',
73 db_send_query(<<<EOLsql
75 id int unique auto_increment,
76 name varchar(200) binary not null default "",
77 username varchar(200) binary not null default "",
78 password varchar(255) binary not null default "",
79 role varchar(200) binary not null default "",
80 last_active int(11) not null default 0,
81 last_login int(11) not null default 0
85 db_send_query(<<<EOLsql
89 password="$2y$10$84xUpPFQFRYRwpGkt01YtObJZcRKGReM/5ywHXCbwDF2bja41CDZm",
93 db_send_query(<<<EOLsql
94 create table paypal_ipn (
95 id int unique auto_increment,
96 txn_id varchar(250) not null default "",
97 status varchar(250) not null default "",
98 ipn_at int(11) not null default 0,
99 txn_type varchar(100) not null default "",
100 subscr_id varchar(100) not null default "",
101 custom varchar(250) not null default "",
102 for_table_id int not null default 0,
103 for_row_id int not null default 0,
104 processed int(1) not null default 0,
105 item_name varchar(250) not null default "",
106 item_number varchar(250) not null default "",
107 needs_review int(1) not null default 0,
108 payment_status varchar(250) not null default "",
109 mc_gross varchar(250) not null default "",
110 mc_currency varchar(250) not null default "",
111 receiver_email varchar(250) not null default "",
112 payer_email varchar(250) not null default "",
113 log text not null default ""
119 function db_upgrade_to_2() {
120 db_send_query(<<<EOLsql
121 create table history_cms_pages (
122 history_id int unique auto_increment,
123 history_when int not null default 0,
124 history_user_id int not null default 0,
126 filename varchar(200) not null default "",
127 title varchar(200) not null default "",
128 nav_title varchar(200) not null default "",
129 navbar int not null default 0,
130 layout int not null default 0,
131 content mediumtext not null default "",
132 sidebar_content mediumtext not null default "",
133 description text not null default "",
134 keywords text not null default ""
138 db_send_query(<<<EOLsql
139 insert into history_cms_pages (