-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathuc_in_person.install
59 lines (56 loc) · 1.49 KB
/
uc_in_person.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
<?php
// $Id$
/**
* @file
* Installation hooks for the uc_in_person module.
*/
/**
* Implementation of hook_install().
*/
function uc_in_person_install() {
drupal_install_schema('uc_in_person');
}
/**
* Implemenatation of hook_uninstall().
*/
function uc_in_person_uninstall() {
drupal_uninstall_schema('uc_in_person');
db_query("DELETE FROM {variable} WHERE name ='uc_in_person_method_review_name'");
db_query("DELETE FROM {variable} WHERE name ='uc_in_person_method_checkout_name'");
db_query("DELETE FROM {variable} WHERE name ='uc_in_person_payment_policy'");
}
/**
* Implemenation of hook_schema().
*/
function uc_in_person_schema() {
$schema = array();
$schema['uc_payment_in_person'] = array(
'description' => 'Stores in_person payment information.',
'fields' => array(
'payment_id' => array(
'description' => 'Primary key: the payment ID.',
'type' => 'serial',
'unsigned' => TRUE,
'not null' => TRUE,
),
'order_id' => array(
'description' => 'The {uc_orders}.order_id.',
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
),
'payment_date' => array(
'description' => 'The Unix timestamp indicating the payment date.',
'type' => 'int',
'not null' => TRUE,
'default' => 0,
),
),
'indexes' => array(
'order_id' => array('order_id'),
),
'primary key' => array('payment_id'),
);
return $schema;
}