| 1 |
<?php
|
| 2 |
/* $Id: blog_reactions.install,v 1.3 2008/07/23 18:39:51 sanduhrs Exp $ */
|
| 3 |
|
| 4 |
/**
|
| 5 |
* Blog reactions
|
| 6 |
*
|
| 7 |
* Fetch blog reactions from Technorati and Google Blog Search
|
| 8 |
*
|
| 9 |
* @author Stefan Auditor <stefan.auditor@erdfisch.de>
|
| 10 |
*/
|
| 11 |
|
| 12 |
/**
|
| 13 |
* Implementation of hook_schema().
|
| 14 |
*/
|
| 15 |
function blog_reactions_schema() {
|
| 16 |
$schema['blog_reactions'] = array(
|
| 17 |
'description' => t('The base table for blog reactions.'),
|
| 18 |
'fields' => array(
|
| 19 |
'nid' => array(
|
| 20 |
'description' => t('The primary identifier for a node.'),
|
| 21 |
'type' => 'int',
|
| 22 |
'unsigned' => TRUE,
|
| 23 |
'not null' => TRUE),
|
| 24 |
'brid' => array(
|
| 25 |
'description' => t('The primary identifier for a rection.'),
|
| 26 |
'type' => 'varchar',
|
| 27 |
'length' => 255,
|
| 28 |
'not null' => TRUE,
|
| 29 |
'default' => ''),
|
| 30 |
'service' => array(
|
| 31 |
'description' => t('The reactions origin.'),
|
| 32 |
'type' => 'varchar',
|
| 33 |
'length' => 255,
|
| 34 |
'not null' => TRUE,
|
| 35 |
'default' => ''),
|
| 36 |
'title' => array(
|
| 37 |
'description' => t('The title for the reaction.'),
|
| 38 |
'type' => 'varchar',
|
| 39 |
'length' => 255,
|
| 40 |
'not null' => TRUE,
|
| 41 |
'default' => ''),
|
| 42 |
'rel' => array(
|
| 43 |
'description' => t('Link rel value.'),
|
| 44 |
'type' => 'varchar',
|
| 45 |
'length' => 255,
|
| 46 |
'not null' => TRUE,
|
| 47 |
'default' => ''),
|
| 48 |
'href' => array(
|
| 49 |
'description' => t('Link destination.'),
|
| 50 |
'type' => 'varchar',
|
| 51 |
'length' => 255,
|
| 52 |
'not null' => TRUE,
|
| 53 |
'default' => ''),
|
| 54 |
'content_type' => array(
|
| 55 |
'description' => t('Link content-type.'),
|
| 56 |
'type' => 'varchar',
|
| 57 |
'length' => 255,
|
| 58 |
'not null' => TRUE,
|
| 59 |
'default' => ''),
|
| 60 |
'comments' => array(
|
| 61 |
'description' => t('Link to comments of reaction.'),
|
| 62 |
'type' => 'varchar',
|
| 63 |
'length' => 255,
|
| 64 |
'not null' => TRUE,
|
| 65 |
'default' => ''),
|
| 66 |
'content' => array(
|
| 67 |
'description' => t('Description for the reaction.'),
|
| 68 |
'type' => 'varchar',
|
| 69 |
'length' => 255,
|
| 70 |
'not null' => TRUE,
|
| 71 |
'default' => ''),
|
| 72 |
'author' => array(
|
| 73 |
'description' => t('Source author name.'),
|
| 74 |
'type' => 'varchar',
|
| 75 |
'length' => 255,
|
| 76 |
'not null' => TRUE,
|
| 77 |
'default' => ''),
|
| 78 |
'uri' => array(
|
| 79 |
'description' => t('Source author website.'),
|
| 80 |
'type' => 'varchar',
|
| 81 |
'length' => 255,
|
| 82 |
'not null' => TRUE,
|
| 83 |
'default' => ''),
|
| 84 |
'published' => array(
|
| 85 |
'description' => t('Published timestamp.'),
|
| 86 |
'type' => 'int',
|
| 87 |
'unsigned' => TRUE,
|
| 88 |
'not null' => TRUE),
|
| 89 |
'updated' => array(
|
| 90 |
'description' => t('Updated timestamp.'),
|
| 91 |
'type' => 'int',
|
| 92 |
'unsigned' => TRUE,
|
| 93 |
'not null' => TRUE),
|
| 94 |
'timestamp' => array(
|
| 95 |
'description' => t('Last fetched timestamp.'),
|
| 96 |
'type' => 'int',
|
| 97 |
'unsigned' => TRUE,
|
| 98 |
'not null' => TRUE),
|
| 99 |
),
|
| 100 |
'indexes' => array(
|
| 101 |
'nid' => array('nid'),
|
| 102 |
'brid' => array('brid'),
|
| 103 |
),
|
| 104 |
);
|
| 105 |
|
| 106 |
return $schema;
|
| 107 |
}
|
| 108 |
|
| 109 |
/**
|
| 110 |
* Implementation of hook_install().
|
| 111 |
*/
|
| 112 |
function blog_reactions_install() {
|
| 113 |
drupal_install_schema('blog_reactions');
|
| 114 |
}
|
| 115 |
|
| 116 |
/**
|
| 117 |
* Implementation of hook_uninstall().
|
| 118 |
*/
|
| 119 |
function blog_reactions_uninstall() {
|
| 120 |
variable_del('blog_reactions_block_items');
|
| 121 |
variable_del('blog_reactions_last_update_nid');
|
| 122 |
drupal_uninstall_schema('blog_reactions');
|
| 123 |
}
|
| 124 |
|
| 125 |
/**
|
| 126 |
* Implementation of hook_update_N().
|
| 127 |
*/
|
| 128 |
function blog_reactions_update_1() {
|
| 129 |
$ret = array();
|
| 130 |
db_add_field($ret, 'blog_reactions', 'service', array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''));
|
| 131 |
return $ret;
|
| 132 |
}
|