Update from 7.x-1.0-beta5 to 7.x-2.0-beta1 doesn't add machine name or status for fields resulting in PDOException

Comments

g089h515r806’s picture

You need first update to 7.x-1.0 RC1, After this update to 7.x-2.0-beta1.

kehan’s picture

Status: Active » Fixed

Thanks.
Not sure what happened to my original post - I had a lot more text in there.

anyway I got around this by running the following code from drush

//from 7.x-1.0-rc1 field_validation.install
	$name = array(
			'type' => 'varchar',
			'description' => 'Machine name of the rule',
			'not null' => TRUE,
			'default' => '',
			'length' => 32,
	);
	db_add_field('field_validation_rule', 'name', $name);
	
	$result = db_query("SELECT ruleid FROM {field_validation_rule}");
  foreach($result as $record){
    //Just use ruleid as machine name, to make it works. You could change the machine name later.
    db_query("UPDATE {field_validation_rule} SET name = :name WHERE ruleid = :ruleid", array(':name' => $record->ruleid, ':ruleid' => $record->ruleid));
  }

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.