/[drupal]/contributions/modules/promote_blocks/promote_blocks.install
ViewVC logotype

Contents of /contributions/modules/promote_blocks/promote_blocks.install

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.2 - (show annotations) (download) (as text)
Wed Sep 19 20:00:47 2007 UTC (2 years, 2 months ago) by emackn
Branch: MAIN
CVS Tags: DRUPAL-5--1-1, DRUPAL-5--1-0, DRUPAL-5--1-2, HEAD
Changes since 1.1: +2 -1 lines
File MIME type: text/x-php
added cvs Id tag
1 <?
2 // $Id: promote_blocks.install,v 1.1.1.1 2007/09/19 19:00:20 emackn Exp $
3
4 /**
5 * @file
6 * The install script for Promote blocks module.
7 * Creates one table for module use.
8 *
9 */
10 function promote_blocks_install() {
11 switch($GLOBALS['db_type']) {
12 case 'mysql':
13 case 'mysqli':
14 db_query("CREATE TABLE {node_field_promote_block} (
15 nid int unsigned NOT NULL default '0',
16 PRIMARY KEY (nid)
17 )");
18 break;
19
20 case 'pgsql':
21 db_query("CREATE TABLE {node_field_promote_block} (
22 nid integer NOT NULL default '0',
23 PRIMARY KEY (nid)
24 )");
25 }
26 }
27
28 function promote_blocks_update_1() {
29 $ret = array();
30
31 switch($GLOBALS['db_type']) {
32 case 'mysql':
33 case 'mysqli':
34 db_query("");
35 $ret[] = update_sql("ALTER TABLE {node_field_promote_block} ADD COLUMN promote tinyint(1) NOT NULL DEFAULT 1");
36 break;
37
38 case 'pgsql':
39 db_add_column($ret, 'node_field_promote_block', 'promote', 'smallint', array('not null' => TRUE, 'default' => 1));
40 break;
41 }
42
43 return $ret;
44 }
45
46
47 function promote_blocks_uninstall() {
48 db_query("DROP TABLE {node_field_promote_block}");
49 }

  ViewVC Help
Powered by ViewVC 1.1.2