tracker_schema()
Implements hook_schema().
File
- core/modules/tracker/tracker.install, line 31
- Install, update, and uninstall functions for tracker.module.
Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 | function tracker_schema() { $schema [ 'tracker_node' ] = array ( 'description' => 'Tracks when nodes were last changed or commented on.' , 'fields' => array ( 'nid' => array ( 'description' => 'The {node}.nid this record tracks.' , 'type' => 'int' , 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0, ), 'published' => array ( 'description' => 'Boolean indicating whether the node is published.' , 'type' => 'int' , 'not null' => FALSE, 'default' => 0, 'size' => 'tiny' , ), 'changed' => array ( 'description' => 'The Unix timestamp when the node was most recently saved or commented on.' , 'type' => 'int' , 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0, ), ), 'indexes' => array ( 'tracker' => array ( 'published' , 'changed' ), ), 'primary key' => array ( 'nid' ), 'foreign keys' => array ( 'tracked_node' => array ( 'table' => 'node' , 'columns' => array ( 'nid' => 'nid' ), ), ), ); $schema [ 'tracker_user' ] = array ( 'description' => 'Tracks when nodes were last changed or commented on, for each user that authored the node or one of its comments.' , 'fields' => array ( 'nid' => array ( 'description' => 'The {node}.nid this record tracks.' , 'type' => 'int' , 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0, ), 'uid' => array ( 'description' => 'The {users}.uid of the node author or commenter.' , 'type' => 'int' , 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0, ), 'published' => array ( 'description' => 'Boolean indicating whether the node is published.' , 'type' => 'int' , 'not null' => FALSE, 'default' => 0, 'size' => 'tiny' , ), 'changed' => array ( 'description' => 'The Unix timestamp when the node was most recently saved or commented on.' , 'type' => 'int' , 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0, ), ), 'indexes' => array ( 'tracker' => array ( 'uid' , 'published' , 'changed' ), ), 'primary key' => array ( 'nid' , 'uid' ), 'foreign keys' => array ( 'tracked_node' => array ( 'table' => 'node' , 'columns' => array ( 'nid' => 'nid' ), ), 'tracked_user' => array ( 'table' => 'users' , 'columns' => array ( 'uid' => 'uid' ), ), ), ); return $schema ; } |
Please login to continue.