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

Contents of /contributions/modules/membership/membership.install

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


Revision 1.2 - (show annotations) (download) (as text)
Wed Feb 20 20:01:15 2008 UTC (21 months ago) by boobaa
Branch: MAIN
CVS Tags: DRUPAL-6--1-0, HEAD
Branch point for: DRUPAL-6--1
Changes since 1.1: +53 -19 lines
File MIME type: text/x-php
update for drupal6
1 <?php
2 // $Id: membership.install,v 1.1 2008/02/17 16:50:46 boobaa Exp $
3
4 /**
5 * Implementation of hook_schema().
6 */
7 function membership_schema() {
8 $schema['membership'] = array(
9 'fields' => array(
10 'mid' => array(
11 'type' => 'serial',
12 'not null' => TRUE,
13 'description' => t('Primary Key: Unique member ID.'),
14 ),
15 'uid' => array(
16 'type' => 'int',
17 'not null' => TRUE,
18 'default' => 0,
19 'description' => t('The {users}.uid who is a member of the given role.'),
20 ),
21 'oid' => array(
22 'type' => 'int',
23 'not null' => TRUE,
24 'default' => 0,
25 'description' => t('The {users}.uid who has last modified this membership.'),
26 ),
27 'lastmod' => array(
28 'type' => 'int',
29 'not null' => TRUE,
30 'default' => 0,
31 'description' => t('The time when the membership was last modified, as a Unix timestamp.'),
32 ),
33 'expires' => array(
34 'type' => 'int',
35 'not null' => TRUE,
36 'default' => 0,
37 'description' => t('The time when the membership will expire, as a Unix timestamp.'),
38 ),
39 ),
40 'indexes' => array(
41 'uid' => array('uid'),
42 'oid' => array('oid'), // This index is probably unused.
43 'lastmod' => array('lastmod'),
44 'expires' => array('expires'),
45 ),
46 'primary key' => array('mid'),
47 );
48 return $schema;
49 }
50
51 /**
52 * Implementation of hook_install().
53 */
54 function membership_install() {
55 // Create tables.
56 drupal_install_schema('membership');
57 }
58
59 /**
60 * Implementation of hook_uninstall().
61 */
62 function membership_uninstall() {
63 // Remove tables.
64 drupal_uninstall_schema('membership');
65 // Remove variables.
66 variable_del('membership_role');
67 variable_del('membership_manager');
68 }
69
70 // vim: set ft=php syntax=php expandtab ts=2 sw=2 autoindent smartindent:

  ViewVC Help
Powered by ViewVC 1.1.2