Mercurial > defr > drupal > ad
comparison notify/ad_notify.install @ 0:d8a3998dac8e ad
ajout module ad
| author | pierre |
|---|---|
| date | Fri, 20 Feb 2009 14:04:09 +0000 |
| parents | |
| children | 948362c2a207 |
comparison
equal
deleted
inserted
replaced
| -1:000000000000 | 0:d8a3998dac8e |
|---|---|
| 1 <?php | |
| 2 // $Id: ad_notify.install,v 1.1.2.2.2.6.2.3 2009/02/16 17:06:49 jeremy Exp $ | |
| 3 | |
| 4 /** | |
| 5 * @file | |
| 6 * Ad_notify module database schema. | |
| 7 * | |
| 8 * Copyright (c) 2005-2009. | |
| 9 * Jeremy Andrews <jeremy@tag1consulting.com>. | |
| 10 */ | |
| 11 | |
| 12 /** | |
| 13 * Implementation of hook_schema(). | |
| 14 */ | |
| 15 function ad_notify_schema() { | |
| 16 $schema['ad_notify'] = array( | |
| 17 'description' => 'The ad_notify table stores notifications data such as recepient, message body, event, etc.', | |
| 18 'fields' => array( | |
| 19 'notid' => array( | |
| 20 'type' => 'serial', | |
| 21 'unsigned' => TRUE, | |
| 22 'not null' => TRUE, | |
| 23 ), | |
| 24 'aid' => array( | |
| 25 'type' => 'int', | |
| 26 'unsigned' => TRUE, | |
| 27 'not null' => TRUE, | |
| 28 'default' => 0, | |
| 29 ), | |
| 30 'oid' => array( | |
| 31 'type' => 'int', | |
| 32 'unsigned' => TRUE, | |
| 33 'not null' => TRUE, | |
| 34 'default' => 0, | |
| 35 ), | |
| 36 'event' => array( | |
| 37 'type' => 'varchar', | |
| 38 'length' => '255', | |
| 39 'not null' => TRUE, | |
| 40 'default' => '' | |
| 41 ), | |
| 42 'delay' => array( | |
| 43 'type' => 'int', | |
| 44 'not null' => TRUE, | |
| 45 'default' => 0, | |
| 46 ), | |
| 47 'queued' => array( | |
| 48 'type' => 'int', | |
| 49 'not null' => TRUE, | |
| 50 'default' => 0, | |
| 51 ), | |
| 52 'sent' => array( | |
| 53 'type' => 'int', | |
| 54 'not null' => TRUE, | |
| 55 'default' => 0, | |
| 56 ), | |
| 57 'counter' => array( | |
| 58 'type' => 'int', | |
| 59 'unsigned' => TRUE, | |
| 60 'not null' => TRUE, | |
| 61 'default' => 0, | |
| 62 ), | |
| 63 'locked' => array( | |
| 64 'type' => 'int', | |
| 65 'unsigned' => TRUE, | |
| 66 'size' => 'tiny', | |
| 67 'not null' => TRUE, | |
| 68 'default' => 0, | |
| 69 ), | |
| 70 'expire' => array( | |
| 71 'type' => 'int', | |
| 72 'unsigned' => TRUE, | |
| 73 'size' => 'tiny', | |
| 74 'not null' => TRUE, | |
| 75 'default' => 0, | |
| 76 ), | |
| 77 'status' => array( | |
| 78 'type' => 'int', | |
| 79 'unsigned' => TRUE, | |
| 80 'size' => 'tiny', | |
| 81 'not null' => TRUE, | |
| 82 'default' => 0, | |
| 83 ), | |
| 84 'address' => array( | |
| 85 'type' => 'varchar', | |
| 86 'length' => '255', | |
| 87 'not null' => TRUE, | |
| 88 'default' => '', | |
| 89 ), | |
| 90 'subject' => array( | |
| 91 'type' => 'varchar', | |
| 92 'length' => '255', | |
| 93 'not null' => TRUE, | |
| 94 'default' => '', | |
| 95 ), | |
| 96 'body' => array( | |
| 97 'type' => 'text', | |
| 98 'not null' => FALSE, | |
| 99 ), | |
| 100 ), | |
| 101 'primary key' => array('notid'), | |
| 102 'unique keys' => array( | |
| 103 'oid' => array('oid', 'event', 'delay'), | |
| 104 ), | |
| 105 'indexes' => array( | |
| 106 'delay' => array('delay'), | |
| 107 'event' => array('event'), | |
| 108 'oid_2' => array('oid'), | |
| 109 'queued' => array('queued'), | |
| 110 'sent' => array('sent'), | |
| 111 'status' => array('status'), | |
| 112 ), | |
| 113 ); | |
| 114 | |
| 115 return $schema; | |
| 116 } | |
| 117 | |
| 118 /** | |
| 119 * ad_notify module installation. | |
| 120 */ | |
| 121 function ad_notify_install() { | |
| 122 drupal_install_schema('ad_notify'); | |
| 123 } | |
| 124 | |
| 125 | |
| 126 /** | |
| 127 * Allow complete uninstallation of the ad_notify module. | |
| 128 */ | |
| 129 function ad_notify_uninstall() { | |
| 130 // Remove tables. | |
| 131 drupal_uninstall_schema('ad_notify'); | |
| 132 } |
