Mercurial > defr > drupal > ad
comparison owners/ad_owners.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_owners.install,v 1.1.2.2 2009/02/16 17:06:49 jeremy Exp $ | |
| 3 | |
| 4 /** | |
| 5 * @file | |
| 6 * Ad_owners module database schema. | |
| 7 * | |
| 8 * Copyright (c) 2009. | |
| 9 * Jeremy Andrews <jeremy@tag1consulting.com>. | |
| 10 */ | |
| 11 | |
| 12 /** | |
| 13 * Implementation of hook_schema(). | |
| 14 */ | |
| 15 function ad_owners_schema() { | |
| 16 $schema['ad_owners'] = array( | |
| 17 'description' => 'Stores information about ad owners. Every ad can have one or more owners.', | |
| 18 'fields' => array( | |
| 19 'oid' => array( | |
| 20 'type' => 'serial', | |
| 21 'not null' => TRUE, | |
| 22 'unsigned' => TRUE, | |
| 23 'description' => 'Unique owner pair ID.', | |
| 24 ), | |
| 25 'aid' => array( | |
| 26 'type' => 'int', | |
| 27 'not null' => TRUE, | |
| 28 'unsigned' => TRUE, | |
| 29 'default' => 0, | |
| 30 'description' => 'Ad id.', | |
| 31 ), | |
| 32 'uid' => array( | |
| 33 'type' => 'int', | |
| 34 'not null' => TRUE, | |
| 35 'unsigned' => TRUE, | |
| 36 'default' => 0, | |
| 37 'description' => 'The {users}.uid that owns ad.', | |
| 38 ), | |
| 39 ), | |
| 40 'primary key' => array('oid'), | |
| 41 'indexes' => array( | |
| 42 'aid' => array('aid'), | |
| 43 'uid' => array('uid'), | |
| 44 ), | |
| 45 ); | |
| 46 | |
| 47 /** | |
| 48 * Permissions can be granted to each owner of each ad. The same owner | |
| 49 * can own multiple ads, and can have different permissions for each ad. | |
| 50 */ | |
| 51 $schema['ad_permissions'] = array( | |
| 52 'description' => 'Permissions can be granted to each owner of each ad. The same owner can own multiple ads, and can have different permissions for each ad.', | |
| 53 'fields' => array( | |
| 54 'oid' => array( | |
| 55 'type' => 'int', | |
| 56 'not null' => TRUE, | |
| 57 'unsigned' => TRUE, | |
| 58 'default' => 0, | |
| 59 'description' => 'Owner pair ID.', | |
| 60 ), | |
| 61 'permissions' => array( | |
| 62 'type' => 'text', | |
| 63 'not null' => FALSE, | |
| 64 'size' => 'big', | |
| 65 'description' => 'Ad permission info.', | |
| 66 ), | |
| 67 ), | |
| 68 'primary key' => array('oid'), | |
| 69 ); | |
| 70 | |
| 71 return $schema; | |
| 72 } | |
| 73 | |
| 74 /** | |
| 75 * ad_external module installation. | |
| 76 */ | |
| 77 function ad_owners_install() { | |
| 78 drupal_install_schema('ad_owners'); | |
| 79 } | |
| 80 | |
| 81 /** | |
| 82 * Allow complete uninstallation of the ad_external module. | |
| 83 */ | |
| 84 function ad_owners() { | |
| 85 drupal_uninstall_schema('ad_owners'); | |
| 86 } |
