summaryrefslogtreecommitdiff
path: root/modules/image/image.install
diff options
context:
space:
mode:
Diffstat (limited to 'modules/image/image.install')
-rw-r--r--modules/image/image.install33
1 files changed, 32 insertions, 1 deletions
diff --git a/modules/image/image.install b/modules/image/image.install
index 1d7bd4ef4..45bcbbb62 100644
--- a/modules/image/image.install
+++ b/modules/image/image.install
@@ -41,11 +41,18 @@ function image_schema() {
'not null' => TRUE,
),
'name' => array(
- 'description' => 'The style name.',
+ 'description' => 'The style machine name.',
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
),
+ 'label' => array(
+ 'description' => 'The style administrative name.',
+ 'type' => 'varchar',
+ 'length' => 255,
+ 'not null' => TRUE,
+ 'default' => '',
+ ),
),
'primary key' => array('isid'),
'unique keys' => array(
@@ -449,6 +456,30 @@ function image_update_7004() {
}
/**
+ * Add a column to the 'image_style' table to store administrative labels.
+ */
+function image_update_7005() {
+ $field = array(
+ 'type' => 'varchar',
+ 'length' => 255,
+ 'not null' => TRUE,
+ 'default' => '',
+ 'description' => 'The style administrative name.',
+ );
+ db_add_field('image_styles', 'label', $field);
+
+ // Do a direct query here, rather than calling image_styles(),
+ // in case Image module is disabled.
+ $styles = db_query('SELECT name FROM {image_styles}')->fetchCol();
+ foreach ($styles as $style) {
+ db_update('image_styles')
+ ->fields(array('label' => $style))
+ ->condition('name', $style)
+ ->execute();
+ }
+}
+
+/**
* @} End of "addtogroup updates-7.x-extra".
*/