From 0610079554bbb43fabf39d07b1d2bc19759f3304 Mon Sep 17 00:00:00 2001 From: Heshan Wanigasooriya Date: Sun, 23 Jan 2011 06:18:15 +0000 Subject: #1026902 by aristeides messageDatabaseSchemaObjectExistsException --- video.install | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) (limited to 'video.install') 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'), -- cgit v1.2.3