0

I had to change the schema of a module I created. I added a function like this:

function cloudinary_update_7200() {    

  $spec = array(
    'keywords' => array('type' => 'longtext', 'not null' => FALSE),
    'primaryImage' => array('type' => 'tinyint', 'default' => 1, 'not null' => FALSE)
  );    

  $cloudinary_field_table = 'field_data_field_cloudinary';
  $revision_table_name = 'field_revision_field_cloudinary';    

  $keywords = 'field_cloudinary_keywords';
  db_add_field($cloudinary_field_table, $keywords, $spec);
  db_add_field($revision_table_name, $keywords, $spec);    

  $primaryImage = 'field_cloudinary_primaryImage';
  db_add_field($cloudinary_field_table, $primaryImage, $spec);
  db_add_field($revision_table_name, $primaryImage, $spec);    

  //UPDATE FIELDS
  $description_spec = array(
    'description' => array('type' => 'longtext', 'not null' => FALSE)
  );
  db_change_field($cloudinary_field_table, "field_cloudinary_alt", "field_cloudinary_description", $description_spec);    

}

So how do I get it to run? I've gone to /update.php but nothing. I tried /admin/modules/update and the module is not listed.

Yes, I have cleared my cash many many times. And yes, I've cleared it again.

1

Rename cloudinary_update_7200 to cloudinary_update_7100 in case if you are using 7.1 version (refer to hook_update_N) and try once again.

If it doesn't work perform SQL query to figure out the number of the latest performed update of the module:

SELECT schema_version FROM system WHERE type = 'module' AND name = 'cloudinary';

If it is 0 - 7100 should work, if it is for instance 7101 - try cloudinary_update_7102.

  • That is a great tip re the select statement. thanks Rostislav! – Mark Robson Aug 22 '14 at 15:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.