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

Contents of /contributions/modules/volunteer_timeslots/volunteer_timeslots.install

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


Revision 1.5 - (show annotations) (download) (as text)
Fri Jul 13 01:11:26 2007 UTC (2 years, 4 months ago) by pwolanin
Branch: MAIN
CVS Tags: HEAD
Changes since 1.4: +2 -1 lines
File MIME type: text/x-php
#150797 remove node type on uninstall
1 <?php
2 // $Id: volunteer_timeslots.install,v 1.4 2007/07/13 00:51:37 pwolanin Exp $
3
4 /**
5 * Implementation of hook_install().
6 */
7 function volunteer_timeslots_install() {
8 switch ($GLOBALS['db_type']) {
9 case 'mysql':
10 case 'mysqli':
11 db_query("CREATE TABLE {volunteer_timeslots} (
12 vid int unsigned NOT NULL default '0',
13 nid int unsigned NOT NULL default '0',
14 timeslot_length int NOT NULL default '1',
15 num_volunteers int NOT NULL default '1',
16 timeslots_organizers varchar(255) NOT NULL default '',
17 timeslot_data longtext NOT NULL,
18 PRIMARY KEY (nid, vid),
19 KEY vid (vid)
20 ) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
21 break;
22 case 'pgsql':
23 db_query("CREATE TABLE {volunteer_timeslots} (
24 vid integer NOT NULL default '0',
25 nid integer NOT NULL default '0',
26 timeslot_length integer NOT NULL default '1',
27 num_volunteers integer NOT NULL default '1',
28 timeslots_organizers varchar(255) NOT NULL default '',
29 timeslot_data text NOT NULL,
30 PRIMARY KEY (nid, vid),
31 UNIQUE (vid)
32 )");
33 break;
34 }
35 variable_set('event_nodeapi_volunteer_timeslots', 'all');
36 variable_set('node_options_volunteer_timeslots', array('status', 'revision'));
37 }
38
39 function volunteer_timeslots_uninstall() {
40 db_query("DELETE FROM {node_type} WHERE module = 'volunteer_timeslots'");
41 db_query("DROP TABLE {volunteer_timeslots}");
42 variable_del('event_nodeapi_volunteer_timeslots');
43 variable_del('node_options_volunteer_timeslots');
44 variable_del('volunteer_timeslots_profile_fields');
45 variable_del('volunteer_timeslots_remind_time');
46 variable_del('volunteer_timeslots_author_manages');
47 variable_del('volunteer_timeslots_organizer_updates');
48 }

  ViewVC Help
Powered by ViewVC 1.1.2