-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathactivitystream.install
More file actions
66 lines (58 loc) · 2.36 KB
/
activitystream.install
File metadata and controls
66 lines (58 loc) · 2.36 KB
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
<?php
/**
* @file
* Installs the tables for activitystream.
*/
/**
* Implementation of hook_install()
*
* This will automatically install the database tables for the Activity Stream
* module for MySQL.
*
* If you are using another database, you will have to install the
* tables by hand, using the queries below as a reference.
*
* Note that the curly braces around table names are a drupal-specific
* feature to allow for automatic database table prefixing, and will
* need to be removed.
*/
function activitystream_install() {
db_query("UPDATE {system} SET weight = 100 WHERE name = 'activitystream'");
node_types_rebuild();
$types = node_type_get_types();
node_add_body_field($types['activitystream']);
}
/**
* Implementation of hook_schema().
*/
function activitystream_schema() {
$schema = array();
$schema['activitystream'] = array(
'fields' => array(
'nid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0, 'disp-width' => '10'),
'module' => array('type' => 'varchar', 'length' => '255', 'not null' => FALSE),
'guid' => array('type' => 'varchar', 'length' => '32', 'not null' => TRUE),
'link' => array('type' => 'text'),
'data' => array('type' => 'text'),
'changed' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0, 'disp-width' => '10')
),
'primary key' => array('guid'),
);
$schema['activitystream_accounts'] = array(
'fields' => array(
'uid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0, 'disp-width' => '10'),
'module' => array('type' => 'varchar', 'length' => '255', 'not null' => FALSE),
'userid' => array('type' => 'varchar', 'length' => '255', 'not null' => FALSE),
'password' => array('type' => 'varchar', 'length' => '255', 'not null' => FALSE),
'feed' => array('type' => 'varchar', 'length' => '255', 'not null' => FALSE),
'lastfetch' => array('mysql_type' => 'datetime', 'not null' => FALSE), //NOTE, see documentation here for why this becomes mysql_type: http://drupal.org/update/modules/6/7#db_specific_types
),
);
return $schema;
}
function activitystream_update_7001(&$sandbox) {
db_drop_primary_key('activitystream');
db_change_field('activitystream', 'link', 'link',
array('type' => 'text'),
array('primary key' => array('guid')));
}