-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsocial_media_flyout.install
82 lines (75 loc) · 2.2 KB
/
social_media_flyout.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
<?php
/**
* @file
* Install, update and uninstall functions for the social_media_flyout module.
*/
use Drupal\Core\Database\Database;
/**
* Implements hook_schema().
*/
function social_media_flyout_schema() {
/*
post_id - auto increment reference id
plugin_id - id of smfprofile plugin (facebook, twitter, instagram, etc.,)
posted - when the post was posted on the profile
retrieved - when the post was retrieved from the API
post_data - an associated array of unique post data, retrieved from the API
*/
$schema['smf_posts'] = array(
'description' => 'Stores posts retrieved from Social Media profiles',
'fields' => array(
'post_id' => array(
'type' => 'serial',
'unsigned' => TRUE,
'not null' => TRUE,
'description' => "An auto-incremented reference ID for the post",
),
'src_post_id' => array(
'type' => 'varchar',
'length' => 64,
'not null' => TRUE,
'default' => '',
'description' => "The source id of the post, dependent on the SMProfile",
),
'plugin_id' => array(
'type' => 'varchar',
'length' => 64,
'not null' => TRUE,
'default' => '',
'description' => "The id of the SMFProfile - Social Media Profile Plugin",
),
'profile_user' => array(
'type' => 'varchar',
'length' => 128,
'not null' => TRUE,
'default' => '',
'description' => "The user name the post belongs to",
),
'posted' => array(
'type' => 'int',
'not null' => TRUE,
'default' => 0,
'description' => "When the post was posted on the profile",
),
'retrieved' => array(
'type' => 'int',
'not null' => TRUE,
'default' => 0,
'description' => "When the post was retrieved from the API",
),
'post_data' => array(
'type' => 'blob',
'not null' => TRUE,
'size' => 'big',
'description' => 'Serialized array of post data',
),
),
'indexes' => array(
'posted_date' => array('posted'),
'retrieved_date' => array('retrieved'),
),
'primary key' => array('post_id'),
);
return $schema;
}
?>