/[drupal]/contributions/modules/itunes/itunes.install
ViewVC logotype

Contents of /contributions/modules/itunes/itunes.install

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.6 - (show annotations) (download) (as text)
Fri Jul 31 23:45:51 2009 UTC (3 months, 3 weeks ago) by drewish
Branch: MAIN
CVS Tags: DRUPAL-6--1-4, HEAD
Changes since 1.5: +22 -3 lines
File MIME type: text/x-php
#481072 by guix and drewish: Add choices for the <itunes:author> source.
1 <?php
2 // $Id: itunes.install,v 1.5 2009/07/31 22:45:06 drewish Exp $
3
4 /**
5 * @file
6 * Installation, updates, and desinstallation of the iTunes module.
7 */
8
9 /**
10 * Implementation of hook_install().
11 */
12 function itunes_install() {
13 // Migrate old audio_itunes data.
14 if (db_table_exists('audio_itunes_item')) {
15 $ret = array();
16 db_rename_table($ret, 'audio_itunes_item', 'itunes_item');
17 }
18 else {
19 drupal_install_schema('itunes');
20 }
21 }
22
23 /**
24 * Implementation of hook_uninstall().
25 */
26 function itunes_uninstall() {
27 drupal_uninstall_schema('itunes');
28 variable_del('itunes_types');
29 variable_del('itunes_enclosure_source');
30 variable_del('itunes_keyword_source');
31 variable_del('itunes_author_source');
32 }
33
34 /**
35 * Implementation of hook_schema().
36 */
37 function itunes_schema() {
38 $schema['itunes_item'] = array(
39 'description' => t('Audio iTunes item.'),
40 'fields' => array(
41 'vid' => array(
42 'type' => 'int',
43 'unsigned' => TRUE,
44 'not null' => TRUE,
45 'default' => 0,
46 ),
47 'nid' => array(
48 'type' => 'int',
49 'unsigned' => TRUE,
50 'not null' => TRUE,
51 'default' => 0,
52 ),
53 'summary' => array(
54 'type' => 'text',
55 'size' => 'medium',
56 'not null' => 'true',
57 ),
58 'subtitle' => array(
59 'type' => 'varchar',
60 'length' => 255,
61 'not null' => 'true',
62 'default' => '',
63 ),
64 'explicit' => array(
65 'type' => 'int',
66 'size' => 'tiny',
67 'not null' => 'true',
68 'default' => 0,
69 ),
70 'block' => array(
71 'type' => 'int',
72 'size' => 'tiny',
73 'not null' => 'true',
74 'default' => 0,
75 ),
76 ),
77 'primary key' => array('vid'),
78 );
79 return $schema;
80 }
81
82 /**
83 * Rename the source variables.
84 */
85 function itunes_update_6100() {
86 $ret = array();
87
88 if ($value = variable_get('itunes_filefields', array())) {
89 variable_set('itunes_enclosure_source', $value);
90 variable_del('itunes_filefields');
91 }
92
93 if ($value = variable_get('itunes_vocabularies', array())) {
94 variable_set('itunes_keyword_source', $value);
95 variable_del('itunes_vocabularies');
96 }
97
98 return $ret;
99 }

  ViewVC Help
Powered by ViewVC 1.1.2