forked from Gizra/og
-
Notifications
You must be signed in to change notification settings - Fork 0
/
og.install
76 lines (71 loc) · 1.75 KB
/
og.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
<?php
/**
* @file
* Install, update, and uninstall functions for the Organic groups module.
*/
/**
* Implements hook_uninstall().
*/
function og_uninstall() {
\Drupal::queue('og_orphaned_group_content')->deleteQueue();
\Drupal::queue('og_orphaned_group_content_cron')->deleteQueue();
}
/**
* Implements hook_schema().
*/
function og_schema() {
$schema = array();
$schema['og_users_roles'] = array(
'description' => 'Maps users to roles.',
'fields' => array(
'id' => array(
'type' => 'serial',
'description' => "The unique identifier.",
'unsigned' => TRUE,
'not null' => TRUE,
),
'uid' => array(
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
'description' => 'Primary Key: {users}.uid for user.',
),
'rid' => array(
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
'description' => 'Primary Key: {og_role}.rid for role.',
),
'gid' => array(
'description' => "The group's unique ID.",
'type' => 'int',
'size' => 'normal',
'not null' => TRUE,
),
'group_type' => array(
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
'default' => '',
'description' => "The group's entity type.",
),
),
'primary key' => array('id'),
'indexes' => array(
'rid' => array('rid'),
),
'foreign keys' => array(
'user' => array(
'table' => 'users',
'columns' => array('uid' => 'uid'),
),
'og_role' => array(
'table' => 'og_role',
'columns' => array('rid' => 'rid'),
),
),
);
return $schema;
}