-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathuc_crowdfunding.install
76 lines (72 loc) · 1.88 KB
/
uc_crowdfunding.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 tables for the
* Ubercart Crowdfunding Feature module.
*
* By Arlina E. Rhoton ("Arlina", http://drupal.org/user/1055344)
*/
/**
* Implements hook_schema().
*/
function uc_crowdfunding_schema() {
$schema = array();
$schema['uc_crowdfunding_products'] = array(
'description' => 'Crowdfunding configuration per product feature.',
'fields' => array(
'cfid' => array(
'description' => 'Crowdfunding feature id',
'type' => 'serial',
'unsigned' => TRUE,
'not null' => TRUE,
),
'pfid' => array(
'description' => 'Product feature id, references {uc_product_features}.pfid.',
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
),
'dateline' => array(
'description' => 'Unix timestamp of the dateline to close the funding.',
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
),
'target' => array(
'description' => 'Target amount to raise.',
'type' => 'numeric',
'precision' => 10,
'scale' => 2,
'not null' => TRUE,
'default' => 0.0,
),
'type' => array(
'description' => 'How the product checks if it is available.',
'type' => 'int',
'size' => 'tiny',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 1,
),
),
'indexes' => array(
'pfid' => array('pfid'),
),
'primary key' => array('cfid'),
);
return $schema;
}
/**
* Implements hook_uninstall().
*/
function uc_crowdfunding_uninstall() {
db_delete('uc_product_features')
->condition('fid', 'crowdfunding')
->execute();
db_delete('variable')
->condition('name', 'uc_crowdfunding_%%', 'LIKE')
->execute();
cache_clear_all('variables', 'cache');
}