From 7a3f4822e882f02540409dc7f316da37fd187c69 Mon Sep 17 00:00:00 2001 From: Dries Buytaert <dries@buytaert.net> Date: Fri, 26 Mar 2010 12:28:06 +0000 Subject: [PATCH] - Patch #735000 by sun, Berdir: installing image.module on a upgrades site does not install schema because of module name overlap. --- modules/image/image.install | 85 +++++++++++++++++++++++++++++++++++++ 1 file changed, 85 insertions(+) diff --git a/modules/image/image.install b/modules/image/image.install index 2cb48520b991..1e3663716d5f 100644 --- a/modules/image/image.install +++ b/modules/image/image.install @@ -104,3 +104,88 @@ function image_schema() { return $schema; } + +/** + * Install the schema for users upgrading from the contributed module. + */ +function image_update_7000() { + if (!db_table_exists('image_styles')) { + $schema = array(); + + $schema['cache_image'] = drupal_get_schema_unprocessed('system', 'cache'); + $schema['cache_image']['description'] = 'Cache table used to store information about image manipulations that are in-progress.'; + + $schema['image_styles'] = array( + 'description' => 'Stores configuration options for image styles.', + 'fields' => array( + 'isid' => array( + 'description' => 'The primary identifier for an image style.', + 'type' => 'serial', + 'unsigned' => TRUE, + 'not null' => TRUE, + ), + 'name' => array( + 'description' => 'The style name.', + 'type' => 'varchar', + 'length' => 255, + 'not null' => TRUE, + ), + ), + 'primary key' => array('isid'), + 'indexes' => array( + 'name' => array('name'), + ), + ); + + $schema['image_effects'] = array( + 'description' => 'Stores configuration options for image effects.', + 'fields' => array( + 'ieid' => array( + 'description' => 'The primary identifier for an image effect.', + 'type' => 'serial', + 'unsigned' => TRUE, + 'not null' => TRUE, + ), + 'isid' => array( + 'description' => 'The {image_styles}.isid for an image style.', + 'type' => 'int', + 'unsigned' => TRUE, + 'not null' => TRUE, + 'default' => 0, + ), + 'weight' => array( + 'description' => 'The weight of the effect in the style.', + 'type' => 'int', + 'unsigned' => FALSE, + 'not null' => TRUE, + 'default' => 0, + ), + 'name' => array( + 'description' => 'The unique name of the effect to be executed.', + 'type' => 'varchar', + 'length' => 255, + 'not null' => TRUE, + ), + 'data' => array( + 'description' => 'The configuration data for the effect.', + 'type' => 'text', + 'not null' => TRUE, + 'size' => 'big', + 'serialize' => TRUE, + ), + ), + 'primary key' => array('ieid'), + 'indexes' => array( + 'isid' => array('isid'), + 'weight' => array('weight'), + ), + 'foreign keys' => array( + 'isid' => array('image_styles' => 'isid'), + ), + ); + db_create_table('cache_image', $schema['cache_image']); + db_create_table('image_styles', $schema['image_styles']); + db_create_table('image_effect', $schema['image_effects']); + } +} + -- GitLab