-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathos2web_adlib_api.install
64 lines (60 loc) · 1.68 KB
/
os2web_adlib_api.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
<?php
/**
* @file
* Install file for the AdLib API implementation module
*/
/**
* Implements hook_schema().
*/
function os2web_adlib_api_schema() {
$schema['os2web_adlib_api_doc_files'] = array(
'description' => 'This table relates cached files from the PWS to the drupal file entry',
'fields' => array(
'fid' => array(
'description' => 'The file entry id.',
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'defualt' => 0,
),
'did' => array(
'description' => 'The document identifier from PWS.',
'type' => 'int',
'unsigned' => TRUE,
),
'jobtype' => array(
'description' => 'Jobtype identifier. 0 = PDF , 1 = HTML',
'type' => 'int',
'unsigned' => TRUE,
),
'job_id' => array(
'description' => 'ID used for the pdf conversion job.',
'type' => 'varchar',
'length' => 128,
),
'job_info' => array(
'description' => 'Information object about the pdf conversion job.',
'type' => 'varchar',
'length' => 1024,
'serialize' => TRUE,
),
),
'primary key' => array('fid', 'jobtype'),
);
return $schema;
}
/**
* Adds job_type field if missing.
*/
function os2web_adlib_api_update_7002(&$sandbox) {
$ret = array();
if (!db_field_exists('os2web_adlib_api_doc_files', 'jobtype')) {
$ret[] = db_add_field('os2web_adlib_api_doc_files', 'jobtype', array(
'description' => 'Jobtype identifier. 0 = PDF , 1 = HTML',
'type' => 'int',
'unsigned' => TRUE,
));
$ret[] = db_add_primary_key('os2web_adlib_api_doc_files', array('fid', 'jobtype'));
}
return $ret;
}