| 1 |
<?php |
<?php |
| 2 |
// $Id: audio_itunes.install,v 1.6 2007/03/07 23:52:01 drewish Exp $ |
// $Id: audio_itunes.install,v 1.1 2007/03/13 18:12:54 drewish Exp $ |
| 3 |
|
|
| 4 |
/** |
/** |
| 5 |
* Install the initial schema. |
* Implementation of hook_install(). |
| 6 |
*/ |
*/ |
| 7 |
function audio_itunes_install() { |
function audio_itunes_install() { |
| 8 |
switch ($GLOBALS['db_type']) { |
drupal_install_schema('audio_itunes'); |
| 9 |
case 'mysql': |
_audio_add_default_perms(); |
|
case 'mysqli': |
|
|
db_query(" |
|
|
CREATE TABLE {audio_itunes_channel} ( |
|
|
`view_id` int(10) unsigned NOT NULL default '0', |
|
|
`subtitle` varchar(255) NOT NULL default '', |
|
|
`summary` longtext NOT NULL, |
|
|
`author` varchar(255) NOT NULL default '', |
|
|
`copyright` varchar(255) NOT NULL default '', |
|
|
`owner_name` varchar(255) NOT NULL default '', |
|
|
`owner_email` varchar(255) NOT NULL default '', |
|
|
`image_url` varchar(255) NOT NULL default '', |
|
|
`block` int(1) unsigned NOT NULL default '0', |
|
|
`explicit` int(1) unsigned NOT NULL default '0', |
|
|
PRIMARY KEY (`view_id`) |
|
|
) /*!40100 DEFAULT CHARACTER SET utf8 */; |
|
|
"); |
|
|
db_query(" |
|
|
CREATE TABLE {audio_itunes_item} ( |
|
|
`vid` int(10) unsigned NOT NULL default '0', |
|
|
`summary` longtext NOT NULL, |
|
|
`subtitle` varchar(255) NOT NULL default '', |
|
|
`explicit` int(1) unsigned NOT NULL default '0', |
|
|
`block` int(1) unsigned NOT NULL default '0', |
|
|
PRIMARY KEY (`vid`) |
|
|
) /*!40100 DEFAULT CHARACTER SET utf8 */; |
|
|
"); |
|
|
break; |
|
|
case 'pgsql': |
|
|
break; |
|
|
} |
|
| 10 |
} |
} |
| 11 |
|
|
| 12 |
/** |
/** |
| 13 |
* Implementation of hook_uninstall(). |
* Implementation of hook_uninstall(). |
| 14 |
*/ |
*/ |
| 15 |
function audio_itunes_uninstall() { |
function audio_itunes_uninstall() { |
| 16 |
db_query('DROP TABLE {audio_itunes_item}'); |
drupal_uninstall_schema('audio_itunes'); |
| 17 |
db_query('DROP TABLE {audio_itunes_channel}'); |
} |
| 18 |
|
|
| 19 |
// variable_del('audio_image_size'); |
/** |
| 20 |
|
* Implementation of hook_schema(). |
| 21 |
|
*/ |
| 22 |
|
function audio_itunes_schema() { |
| 23 |
|
$schema['audio_itunes_channel'] = array( |
| 24 |
|
'description' => t('Audio iTunes channel.'), |
| 25 |
|
'fields' => array( |
| 26 |
|
'view_id' => array( |
| 27 |
|
'type' => 'int', |
| 28 |
|
'size' => 'medium', |
| 29 |
|
'not null' => 'true', |
| 30 |
|
'default' => 0, |
| 31 |
|
), |
| 32 |
|
'subtitle' => array( |
| 33 |
|
'type' => 'varchar', |
| 34 |
|
'length' => 255, |
| 35 |
|
'not null' => 'true', |
| 36 |
|
'default' => '', |
| 37 |
|
), |
| 38 |
|
'summary' => array( |
| 39 |
|
'type' => 'text', |
| 40 |
|
'size' => 'medium', |
| 41 |
|
'not null' => 'true', |
| 42 |
|
), |
| 43 |
|
'author' => array( |
| 44 |
|
'type' => 'varchar', |
| 45 |
|
'length' => 255, |
| 46 |
|
'not null' => 'true', |
| 47 |
|
'default' => '', |
| 48 |
|
), |
| 49 |
|
'copyright' => array( |
| 50 |
|
'type' => 'varchar', |
| 51 |
|
'length' => 255, |
| 52 |
|
'not null' => 'true', |
| 53 |
|
'default' => '', |
| 54 |
|
), |
| 55 |
|
'owner_name' => array( |
| 56 |
|
'type' => 'varchar', |
| 57 |
|
'length' => 255, |
| 58 |
|
'not null' => 'true', |
| 59 |
|
'default' => '', |
| 60 |
|
), |
| 61 |
|
'owner_email' => array( |
| 62 |
|
'type' => 'varchar', |
| 63 |
|
'length' => 255, |
| 64 |
|
'not null' => 'true', |
| 65 |
|
'default' => '', |
| 66 |
|
), |
| 67 |
|
'image_url' => array( |
| 68 |
|
'type' => 'varchar', |
| 69 |
|
'length' => 255, |
| 70 |
|
'not null' => 'true', |
| 71 |
|
'default' => '', |
| 72 |
|
), |
| 73 |
|
'block' => array( |
| 74 |
|
'type' => 'int', |
| 75 |
|
'size' => 'tiny', |
| 76 |
|
'not null' => 'true', |
| 77 |
|
'default' => 0, |
| 78 |
|
), |
| 79 |
|
'explicit' => array( |
| 80 |
|
'type' => 'int', |
| 81 |
|
'size' => 'tiny', |
| 82 |
|
'not null' => 'true', |
| 83 |
|
'default' => 0, |
| 84 |
|
), |
| 85 |
|
), |
| 86 |
|
'primary key' => array('view_id'), |
| 87 |
|
); |
| 88 |
|
$schema['audio_itunes_item'] = array( |
| 89 |
|
'description' => t('Audio iTunes item.'), |
| 90 |
|
'fields' => array( |
| 91 |
|
'vid' => array( |
| 92 |
|
'type' => 'int', |
| 93 |
|
'size' => 'medium', |
| 94 |
|
'not null' => 'true', |
| 95 |
|
'default' => 0, |
| 96 |
|
), |
| 97 |
|
'summary' => array( |
| 98 |
|
'type' => 'text', |
| 99 |
|
'size' => 'medium', |
| 100 |
|
'not null' => 'true', |
| 101 |
|
), |
| 102 |
|
'subtitle' => array( |
| 103 |
|
'type' => 'varchar', |
| 104 |
|
'length' => 255, |
| 105 |
|
'not null' => 'true', |
| 106 |
|
'default' => '', |
| 107 |
|
), |
| 108 |
|
'author' => array( |
| 109 |
|
'type' => 'varchar', |
| 110 |
|
'length' => 255, |
| 111 |
|
'not null' => 'true', |
| 112 |
|
'default' => '', |
| 113 |
|
), |
| 114 |
|
'block' => array( |
| 115 |
|
'type' => 'int', |
| 116 |
|
'size' => 'tiny', |
| 117 |
|
'not null' => 'true', |
| 118 |
|
'default' => 0, |
| 119 |
|
), |
| 120 |
|
'explicit' => array( |
| 121 |
|
'type' => 'int', |
| 122 |
|
'size' => 'tiny', |
| 123 |
|
'not null' => 'true', |
| 124 |
|
'default' => 0, |
| 125 |
|
), |
| 126 |
|
), |
| 127 |
|
'primary key' => array('vid'), |
| 128 |
|
); |
| 129 |
|
return $schema; |
| 130 |
} |
} |