| 1 |
<?php |
<?php |
| 2 |
// $Id: userpoints.install,v 1.15.2.3 2009/03/29 19:13:04 kbahey Exp $ |
// $Id: userpoints.install,v 1.15.2.4 2009/07/15 20:44:07 kbahey Exp $ |
| 3 |
|
|
| 4 |
/** |
/** |
| 5 |
* Implementation of hook_schema(). |
* Implementation of hook_schema(). |
| 10 |
'description' => 'Holds the user points', |
'description' => 'Holds the user points', |
| 11 |
'fields' => array( |
'fields' => array( |
| 12 |
'pid' => array( |
'pid' => array( |
| 13 |
'description' => t('User ID'), |
'description' => 'User ID', |
| 14 |
'type' => 'serial', |
'type' => 'serial', |
| 15 |
'not null' => TRUE, |
'not null' => TRUE, |
| 16 |
), |
), |
| 17 |
'uid' => array( |
'uid' => array( |
| 18 |
'description' => t('User ID'), |
'description' => 'User ID', |
| 19 |
'type' => 'int', |
'type' => 'int', |
| 20 |
'not null' => TRUE, |
'not null' => TRUE, |
| 21 |
'default' => 0, |
'default' => 0, |
| 22 |
), |
), |
| 23 |
'points' => array( |
'points' => array( |
| 24 |
'description' => t('Current Points'), |
'description' => 'Current Points', |
| 25 |
'type' => 'int', |
'type' => 'int', |
| 26 |
'not null' => TRUE, |
'not null' => TRUE, |
| 27 |
'default' => 0, |
'default' => 0, |
| 28 |
), |
), |
| 29 |
'max_points' => array( |
'max_points' => array( |
| 30 |
'description' => t('Out of a maximum points'), |
'description' => 'Out of a maximum points', |
| 31 |
'type' => 'int', |
'type' => 'int', |
| 32 |
'not null' => TRUE, |
'not null' => TRUE, |
| 33 |
'default' => 0, |
'default' => 0, |
| 34 |
), |
), |
| 35 |
'last_update' => array( |
'last_update' => array( |
| 36 |
'description' => t('Timestamp'), |
'description' => 'Timestamp', |
| 37 |
'type' => 'int', |
'type' => 'int', |
| 38 |
'not null' => TRUE, |
'not null' => TRUE, |
| 39 |
'default' => 0, |
'default' => 0, |
| 40 |
), |
), |
| 41 |
'tid' => array( |
'tid' => array( |
| 42 |
'description' => t('Category ID'), |
'description' => 'Category ID', |
| 43 |
'type' => 'int', |
'type' => 'int', |
| 44 |
'not null' => TRUE, |
'not null' => TRUE, |
| 45 |
'default' => 0, |
'default' => 0, |
| 53 |
); |
); |
| 54 |
|
|
| 55 |
$schema['userpoints_txn'] = array( |
$schema['userpoints_txn'] = array( |
| 56 |
'description' => t('Userpoints Transactions'), |
'description' => 'Userpoints Transactions', |
| 57 |
'fields' => array( |
'fields' => array( |
| 58 |
'txn_id' => array( |
'txn_id' => array( |
| 59 |
'description' => t('Transaction ID'), |
'description' => 'Transaction ID', |
| 60 |
'type' => 'serial', |
'type' => 'serial', |
| 61 |
'not null' => TRUE, |
'not null' => TRUE, |
| 62 |
), |
), |
| 63 |
'uid' => array( |
'uid' => array( |
| 64 |
'description' => t('User ID'), |
'description' => 'User ID', |
| 65 |
'type' => 'int', |
'type' => 'int', |
| 66 |
'not null' => TRUE, |
'not null' => TRUE, |
| 67 |
'default' => 0, |
'default' => 0, |
| 68 |
), |
), |
| 69 |
'approver_uid' => array( |
'approver_uid' => array( |
| 70 |
'description' => t('Approving User ID'), |
'description' => 'Approving User ID', |
| 71 |
'type' => 'int', |
'type' => 'int', |
| 72 |
'not null' => TRUE, |
'not null' => TRUE, |
| 73 |
'default' => 0, |
'default' => 0, |
| 74 |
), |
), |
| 75 |
'points' => array( |
'points' => array( |
| 76 |
'description' => t('Points'), |
'description' => 'Points', |
| 77 |
'type' => 'int', |
'type' => 'int', |
| 78 |
'not null' => TRUE, |
'not null' => TRUE, |
| 79 |
'default' => 0, |
'default' => 0, |
| 80 |
), |
), |
| 81 |
'time_stamp' => array( |
'time_stamp' => array( |
| 82 |
'description' => t('Timestamp'), |
'description' => 'Timestamp', |
| 83 |
'type' => 'int', |
'type' => 'int', |
| 84 |
'not null' => TRUE, |
'not null' => TRUE, |
| 85 |
'default' => 0, |
'default' => 0, |
| 86 |
), |
), |
| 87 |
'changed' => array( |
'changed' => array( |
| 88 |
'description' => t('Effective timestamp of last action on this transaction, for tracking purposes.'), |
'description' => 'Effective timestamp of last action on this transaction, for tracking purposes.', |
| 89 |
'type' => 'int', |
'type' => 'int', |
| 90 |
'not null' => TRUE, |
'not null' => TRUE, |
| 91 |
'default' => 0, |
'default' => 0, |
| 92 |
), |
), |
| 93 |
'status' => array( |
'status' => array( |
| 94 |
'description' => t('Status'), |
'description' => 'Status', |
| 95 |
'type' => 'int', |
'type' => 'int', |
| 96 |
'size' => 'tiny', |
'size' => 'tiny', |
| 97 |
'not null' => TRUE, |
'not null' => TRUE, |
| 98 |
'default' => 0, |
'default' => 0, |
| 99 |
), |
), |
| 100 |
'description' => array( |
'description' => array( |
| 101 |
'description' => t('Description'), |
'description' => 'Description', |
| 102 |
'type' => 'text', |
'type' => 'text', |
| 103 |
), |
), |
| 104 |
'reference' => array( |
'reference' => array( |
| 105 |
'description' => t('Reserved for module specific use'), |
'description' => 'Reserved for module specific use', |
| 106 |
'type' => 'varchar', |
'type' => 'varchar', |
| 107 |
'length' => 128, |
'length' => 128, |
| 108 |
), |
), |
| 109 |
'expirydate' => array( |
'expirydate' => array( |
| 110 |
'description' => t('Expirydate'), |
'description' => 'Expirydate', |
| 111 |
'type' => 'int', |
'type' => 'int', |
| 112 |
'not null' => TRUE, |
'not null' => TRUE, |
| 113 |
'default' => 0, |
'default' => 0, |
| 114 |
), |
), |
| 115 |
'expired' => array( |
'expired' => array( |
| 116 |
'description' => t('User ID'), |
'description' => 'User ID', |
| 117 |
'type' => 'int', |
'type' => 'int', |
| 118 |
'size' => 'tiny', |
'size' => 'tiny', |
| 119 |
'not null' => TRUE, |
'not null' => TRUE, |
| 120 |
'default' => 0, |
'default' => 0, |
| 121 |
), |
), |
| 122 |
'parent_txn_id' => array( |
'parent_txn_id' => array( |
| 123 |
'description' => t('Parent Transaction ID'), |
'description' => 'Parent Transaction ID', |
| 124 |
'type' => 'int', |
'type' => 'int', |
| 125 |
'not null' => TRUE, |
'not null' => TRUE, |
| 126 |
'default' => 0, |
'default' => 0, |
| 127 |
), |
), |
| 128 |
'tid' => array( |
'tid' => array( |
| 129 |
'description' => t('Category ID'), |
'description' => 'Category ID', |
| 130 |
'type' => 'int', |
'type' => 'int', |
| 131 |
'not null' => TRUE, |
'not null' => TRUE, |
| 132 |
'default' => 0, |
'default' => 0, |
| 133 |
), |
), |
| 134 |
'entity_id' => array( |
'entity_id' => array( |
| 135 |
'description' => t('ID of an entity in the Database'), |
'description' => 'ID of an entity in the Database', |
| 136 |
'type' => 'int', |
'type' => 'int', |
| 137 |
'not null' => TRUE, |
'not null' => TRUE, |
| 138 |
'default' => 0, |
'default' => 0, |
| 139 |
), |
), |
| 140 |
'entity_type' => array( |
'entity_type' => array( |
| 141 |
'description' => t('Type of entity'), |
'description' => 'Type of entity', |
| 142 |
'type' => 'varchar', |
'type' => 'varchar', |
| 143 |
'length' => 32, |
'length' => 32, |
| 144 |
), |
), |
| 145 |
'operation' => array( |
'operation' => array( |
| 146 |
'description' => t('Operation being carried out'), |
'description' => 'Operation being carried out', |
| 147 |
'type' => 'varchar', |
'type' => 'varchar', |
| 148 |
'length' => 32, |
'length' => 32, |
| 149 |
), |
), |
| 262 |
'type' => 'int', |
'type' => 'int', |
| 263 |
'not null' => TRUE, |
'not null' => TRUE, |
| 264 |
'default' => 0, |
'default' => 0, |
| 265 |
'description' => t("Efective timestamp of last action on this transaction, for tracking purposes."), |
'description' => 'Effective timestamp of last action on this transaction, for tracking purposes.', |
| 266 |
) |
) |
| 267 |
); |
); |
| 268 |
//Optional: An index could help about tracking operations so it would be better to define here.. |
//Optional: An index could help about tracking operations so it would be better to define here.. |