aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHeshan Wanigasooriya <heshanmw@gmail.com>2011-01-23 06:18:15 +0000
committerHeshan Wanigasooriya <heshanmw@gmail.com>2011-01-23 06:18:15 +0000
commit0610079554bbb43fabf39d07b1d2bc19759f3304 (patch)
treebba929873145899eb5ccb998e86edb2bc267f842
parent1716ca811681ee5364cc096883add4d6fcf74831 (diff)
downloadvideo-0610079554bbb43fabf39d07b1d2bc19759f3304.tar.gz
video-0610079554bbb43fabf39d07b1d2bc19759f3304.tar.bz2
#1026902 by aristeides messageDatabaseSchemaObjectExistsException
-rw-r--r--video.install21
1 files changed, 9 insertions, 12 deletions
diff --git a/video.install b/video.install
index bec9c52..09af873 100644
--- a/video.install
+++ b/video.install
@@ -82,14 +82,15 @@ function video_schema() {
* Implementation of hook_install().
*/
function video_install() {
- drupal_install_schema('video');
+ // Create the videos directory and ensure it's writable.
+ $directory = file_default_scheme() . '://videos';
+ file_prepare_directory($directory, FILE_CREATE_DIRECTORY | FILE_MODIFY_PERMISSIONS);
}
/**
* Implementation of hook_uninstall().
*/
function video_uninstall() {
- return;
drupal_uninstall_schema('video');
// Delete all variables which begin with the namespaced "video_*".
// $video_vars = array();
@@ -100,13 +101,15 @@ function video_uninstall() {
// variable_del($result['name']);
// }
// }
+//
+ // Remove the video directory and generated images.
+ file_unmanaged_delete_recursive(file_default_scheme() . '://videos');
}
/**
* Implements hook_field_schema().
*/
function video_field_schema($field) {
- return;
return array(
'columns' => array(
'fid' => array(
@@ -115,8 +118,8 @@ function video_field_schema($field) {
'not null' => FALSE,
'unsigned' => TRUE,
),
- 'fid' => array(
- 'description' => 'The {file_managed}.fid being referenced in this field.',
+ 'thumbanail' => array(
+ 'description' => 'The {file_managed}.fid for the video thumbanil.',
'type' => 'int',
'not null' => FALSE,
'unsigned' => TRUE,
@@ -126,13 +129,7 @@ function video_field_schema($field) {
'type' => 'varchar',
'length' => 32,
'not null' => FALSE,
- ),
- 'title' => array(
- 'description' => "Image title text, for the image's 'title' attribute.",
- 'type' => 'varchar',
- 'length' => 128,
- 'not null' => FALSE,
- ),
+ )
),
'indexes' => array(
'fid' => array('fid'),