aboutsummaryrefslogtreecommitdiff
path: root/modules/video_s3/video_s3.install
blob: 77190704706bb6ff127b5b13445a7546d424e5b8 (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
<?php
/**
 * @file
 * Provides installation functions for video_s3.module.
 */

/**
 * Implementation of hook_schema().
 */
function video_s3_schema() {
  $schema['video_s3'] = array(
    'description' => t('Store video s3 cdn'),
    'fields' => array(
  	  'vid' => array(
        'description' => t('Auto Increment id'),
        'type' => 'serial',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'fid' => array(
        'description' => t('Original file id'),
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'nid' => array(
        'description' => t('Node id'),
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'bucket' => array(
        'type' => 'varchar',
        'length' => '255',
        'default' => '',
        'description' => t('The bucket the video is stored in.'),
      ),
	  'filename' => array(
        'type' => 'varchar',
        'length' => '255',
        'default' => '',
        'description' => t('The filename of the video.'),
      ),
	  'filepath' => array(
        'type' => 'varchar',
        'length' => '255',
        'default' => '',
        'description' => t('The filepath of the video.'),
      ),
	  'filemime' => array(
        'type' => 'varchar',
        'length' => '255',
        'default' => '',
        'description' => t('The filemime of the video.'),
      ),
      'filesize' => array(
        'description' => t('Filesize of the video.'),
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'status' => array(
        'description' => t('Status of the cdn transfer'),
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'completed' => array(
        'description' => t('Time of successful completion to amazon.'),
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
      ),
    ),
    'indexes' => array(
      'status' => array('status'),
      'file' => array('fid'),
    ),
    'primary key' => array('vid'),
  );
  return $schema;
}

/**
 * Implementation of hook_install().
 */
function video_s3_install() {
  drupal_install_schema('video_s3');
}

/**
 * Implementation of hook_uninstall().
 */
function video_s3_uninstall() {
  drupal_uninstall_schema('video_s3');
  // Delete our variables.
  variable_del('amazon_s3');
  variable_del('amazon_s3_ssl');
  variable_del('amazon_s3_access_key');
  variable_del('amazon_s3_secret_access_key');
  variable_del('amazon_s3_bucket');
}