commit prior to a release just to get people to stop reporting this bug
[project/panels.git] / panels.install
1 <?php
2 // $Id$
3
4 /**
5 * Install the panels tables
6 */
7 function panels_install() {
8 switch ($GLOBALS['dbtype']) {
9 case 'pgsql':
10 db_query(<<<EOT
11 CREATE TABLE {panels_info} (
12 did int not null default 0 primary key,
13 title varchar(128),
14 access varchar(128),
15 path varchar(128),
16 css_id varchar(128),
17 layout varchar(32)
18 );
19 EOT
20 );
21
22 db_query("CREATE SEQUENCE {panels_info}_id_seq;");
23
24 db_query(<<<EOT
25 CREATE TABLE {panels_area} (
26 did int NOT NULL DEFAULT 0,
27 area varchar(32),
28 type varchar(32),
29 configuration text,
30 position int
31 );
32 EOT
33 );
34
35 db_query("CREATE INDEX {panels_area}_did_idx ON {panels_area} (did);");
36 break;
37 case 'mysql':
38 case 'mysqli':
39 default:
40 db_query(<<<EOT
41 create table {panels_info} (
42 did int(10) not null default 0 primary key,
43 title varchar(128),
44 access varchar(128),
45 path varchar(128),
46 css_id varchar(128),
47 layout varchar(32)
48 ) /*!40100 DEFAULT CHARACTER SET utf8 */
49 EOT
50 );
51 db_query(<<<EOT
52 create table {panels_area} (
53 did int(10) not null default 0,
54 area varchar(32),
55 type varchar(32),
56 configuration longtext,
57 position int(5),
58 key (did)
59 ) /*!40100 DEFAULT CHARACTER SET utf8 */
60 EOT
61 );
62 }
63 }
64
65 /**
66 * Uninstall the panels tables
67 */
68 function panels_uninstall() {
69 switch ($GLOBALS['db_type']) {
70 case 'pgsql':
71 case 'mysql':
72 case 'mysqli':
73 default:
74 db_query("DROP TABLE {panels_info}");
75 db_query("DROP TABLE {panels_area}");
76 }
77 }
78
79 /**
80 * Update the tables to UTF-8
81 */
82 function panels_update_1() {
83 return _system_update_utf8(array('panels_info', 'panels_area'));
84 }