-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtwitterwall.install
109 lines (100 loc) · 2.63 KB
/
twitterwall.install
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
<?php
/**
* Implementation of hook_schema().
*/
function twitterwall_schema() {
$schema['twitterwall'] = array(
'description' => 'Contains imported tweets',
'fields' => array(
'id' => array(
'description' => 'The primary key',
'type' => 'serial',
),
'tweetid' => array(
'description' => 'The primary identifier for a tweet',
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
),
'created_at_epoch' => array(
'description' => 'The tweet date epoch format',
'type' => 'int',
'not null' => TRUE,
),
'created_at' => array(
'description' => 'The tweet date',
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
),
'profile_image_url' => array(
'description' => 'The url of the profile image',
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
),
'from_user' => array(
'description' => 'User that sent the tweet',
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
),
'from_userid' => array(
'description' => 'User ID that sent the tweet',
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
),
'to_user' => array(
'description' => 'User that received the tweet',
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
),
'message' => array(
'description' => 'The message',
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
),
'status' => array(
'description' => 'The status of the tweet',
'type' => 'int',
'not null' => TRUE,
),
),
'primary key' => array('id'),
);
return $schema;
}
/**
* Implementation of hook_install().
*/
function twitterwall_install() {
drupal_install_schema('twitterwall');
}
/**
* Twitpocalypse then!
*/
function twitterwall_update_6000() {
$ret = array() ;
db_change_field($ret, 'twitterwall', 'tweetid', 'tweetid', array('type' => 'varchar', 'length' => '255'));
return $ret ;
}
/**
* Twitpocalypse then!
*/
function twitterwall_update_6000() {
$ret = array() ;
db_change_field($ret, 'twitterwall', 'tweetid', 'tweetid', array('type' => 'varchar', 'length' => '255'));
return $ret ;
}
/**
* Implementation of hook_uninstall().
*/
function twitterwall_uninstall() {
drupal_uninstall_schema('twitterwall');
$sql = "DELETE FROM {variables} WHERE name LIKE 'twitterwall_%'";
db_query($sql);
drupal_set_message(t('Removed all twitterwall variables.'));
}