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

Contents of /contributions/modules/feedback/feedback.install

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


Revision 1.10 - (show annotations) (download) (as text)
Thu Oct 1 03:20:33 2009 UTC (8 weeks, 2 days ago) by sun
Branch: MAIN
CVS Tags: HEAD
Changes since 1.9: +1 -9 lines
File MIME type: text/x-php
by sun: Ported to Drupal 7.
1 <?php
2 // $Id: feedback.install,v 1.9 2009/03/21 20:22:14 sun Exp $
3
4 /**
5 * Implementation of hook_schema().
6 */
7 function feedback_schema() {
8 $schema['feedback'] = array(
9 'description' => t('Stores all feedback messages.'),
10 'fields' => array(
11 'fid' => array('type' => 'serial', 'unsigned' => TRUE, 'not null' => TRUE,
12 'description' => t('The primary identifier for a feedback message.'),
13 ),
14 'uid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0,
15 'description' => t('The user id of the author of a feedback message.'),
16 ),
17 'status' => array('type' => 'int', 'size' => 'tiny', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0,
18 'description' => t('The status of a feedback message.'),
19 ),
20 'message' => array('type' => 'text', 'size' => 'big', 'not null' => TRUE,
21 'description' => t('The actual feedback message.'),
22 ),
23 'location' => array('type' => 'text', 'not null' => TRUE,
24 'description' => t('The internal Drupal path of the page the feedback message was submitted on.'),
25 ),
26 'location_masked' => array('type' => 'text', 'not null' => TRUE,
27 'description' => t('The masked Drupal path of the page the feedback message was submitted on.'),
28 ),
29 'url' => array('type' => 'text', 'not null' => TRUE,
30 'description' => t('The absolute URL of the page the feedback message was submitted on.'),
31 ),
32 'useragent' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE,
33 'description' => t('The user agent of the feedback message author.'),
34 ),
35 'timestamp' => array('type' => 'int', 'not null' => TRUE, 'default' => 0,
36 'description' => t('The UNIX timestamp when the feedback message was created.'),
37 ),
38 ),
39 'primary key' => array('fid'),
40 'indexes' => array(
41 'location' => array(array('location', 32)),
42 'location_masked' => array(array('location_masked', 32)),
43 ),
44 );
45 return $schema;
46 }
47
48 /**
49 * Implementation of hook_uninstall().
50 */
51 function feedback_uninstall() {
52 db_query("DELETE FROM {variable} WHERE name LIKE 'feedback_%%'");
53 }
54
55 /**
56 * Change fid into type serial field.
57 */
58 function feedback_update_6100() {
59 $ret = array();
60 db_drop_primary_key($ret, 'feedback');
61 db_change_field($ret, 'feedback', 'fid', 'fid', array('type' => 'serial', 'unsigned' => TRUE, 'not null' => TRUE), array('primary key' => array('fid')));
62 return $ret;
63 }
64
65 /**
66 * Add column for absolute URL.
67 */
68 function feedback_update_6101() {
69 $ret = array();
70 db_add_field($ret, 'feedback', 'url', array('type' => 'text', 'not null' => TRUE));
71 $ret[] = update_sql("UPDATE {feedback} SET url = location");
72 return $ret;
73 }
74

  ViewVC Help
Powered by ViewVC 1.1.2