After update.php:

user warning: Table 'myprefix_drupal.content_moderation_states' doesn't exist query: ALTER TABLE `content_moderation_states` ADD `weight` SMALLINT NOT NULL DEFAULT '0' in /disk1/www/vhosts/myprefix.com/httpdocs/sites/all/modules/content_moderation/content_moderation.install on line 101.

The following queries were executed
content_moderation module
Update #6003
No queries

Comments

eugenmayer’s picture

Was it the first installation for you? MYSQL or postgresql?

eugenmayer’s picture

Priority: Critical » Minor
TyraelTLK’s picture

I was updating my 1.2 installation (that was an update of a previus version). Mysql.

eugenmayer’s picture

Do you use prefixes?

eugenmayer’s picture

Title: update to 1.3 - update.php error » update to 1.3 - update.php error when using table prefixes
Status: Active » Fixed

Well yes, my bad:

content_moderation.install

Please change the method

function content_moderation_update_6003() {
  db_query("ALTER TABLE `content_moderation_states` ADD `weight` SMALLINT NOT NULL DEFAULT '0'");
  return array();
}

to

function content_moderation_update_6004() {
  db_query("ALTER TABLE {content_moderation_states} ADD `weight` SMALLINT NOT NULL DEFAULT '0'");
  return array();
}

And run the update.php script once again.

This is not urgent as weights are not yet used, they will be part of the next release. So you can also wait for 1.4 without problems

TyraelTLK’s picture

Status: Fixed » Active

OK thanks!

TyraelTLK’s picture

Status: Active » Fixed

ops :)

broon’s picture

Actually we should use drupals update functionality in order to display performed database actions.

function content_moderation_update_6003() {
  $ret = array();
  if (db_table_exists('content_moderation_states')) {
    db_add_field($ret, 'content_moderation_states', 'weight', array('type' => 'int', 'not null' => TRUE, 'default' => 0, 'size' => 'tiny'));
  }
  return $ret;
}

I'll put that on my todo list for code cleanup.

eugenmayer’s picture

Paul use 6004 due to this error

broon’s picture

Of course, this was just an example. When cleaning up the code I will increment the numbers.

eugenmayer’s picture

Status: Fixed » Closed (fixed)

released in in 1.4