You are here

function node_limit_update_7001 in Node Limit 8

Same name and namespace in other branches
  1. 7 node_limit.install \node_limit_update_7001()

Implements hook_update_N().

Renaming limit field to avoid mysql restricted name usage.

File

old/node_limit.install, line 61

Code

function node_limit_update_7001() {

  // Cannot use db_change_field() because of the restricted name.
  $ret = \Drupal::database()
    ->query("ALTER TABLE {node_limit} CHANGE `limit` `limit_count` INT(11) NOT NULL DEFAULT '-1' COMMENT 'The node limit for this limit'");
  return !empty($ret);
}