aboutsummaryrefslogtreecommitdiff
path: root/reminder.install
blob: d958832a58f45d1e9f16d4924ef96004fa11aa53 (plain)
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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
<?php

/**
 * @file
 *
 * Reminder installation callbacks.
 */

/**
 * Implements hook_schema()
 */
function reminder_schema() {
  $schema['reminder'] = array(
    'description' => 'The main informations of the reminders.',
    'fields' => array(
      'nid' => array(
        'description' => 'The contact with the base node.',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE
      ),
      'uid' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0
      ),
      'anonym_name' => array(
        'type' => 'varchar',
        'length' => 100,
        'default' => ''
      ),
      'anonym_email' => array(
        'type' => 'varchar',
        'length' => 100,
        'default' => ''
      ),
      'until' => array(
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '0'
      ),
      'interval' => array(
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '0'
      ),
      'url' => array(
        'type' => 'varchar',
        'length' => 10,
        'not null' => TRUE,
        'default' => ''
      ),
      'admin_url' => array(
        'type' => 'varchar',
        'length' => 25,
        'not null' => TRUE,
        'default' => ''
      ),
      'secure' => array(
        'type' => 'int',
        'not null' => TRUE,
        'default' => '0'
      ),
    ),
    'primary key' => array('nid'),
  );

  $schema['reminder_subscriptions'] = array(
    'description' => 'The table of subscribed users.',
    'fields' => array(
      'id' => array(
        'type' => 'serial',
        'unsigned' => TRUE,
        'not null' => TRUE
      ),
      'email' => array(
        'type' => 'varchar',
        'length' => 100,
        'default' => ''
      ),
      'reminder_id' => array(
        'type' => 'int',
        'not null' => TRUE,
        'unsigned' => TRUE,
        'default' => 0
      ),
      'unsubscribe_url' => array(
        'type' => 'varchar',
        'length' => 25,
        'not null' => TRUE,
        'default' => ''
      ),
    ),

    'primary key' => array('id'),
  );

  $schema['reminder_logs'] = array(
    'description' => 'Log table.',
    'fields' => array(
      'log_id' => array(
        'type' => 'serial',
        'unsigned' => TRUE,
        'not null' => TRUE
      ),
      'nid' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0
      ),
      'username' => array(
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => ''
      ),
      'dt' => array(
        'type' => 'int',
        'not null' => TRUE,
      ),
    ),

    'primary key' => array('log_id'),
  );

  return $schema;
}