When upgrading a D6 site to D7:

Failed: DatabaseSchemaObjectDoesNotExistException: Cannot add field radioactivity_decay_profile.enable_decay: table doesn't exist. in DatabaseSchema_mysql->addField() (line 320 of /disk2/www/includes/database/mysql/schema.inc).

Analysis, in radioactivity_update_7200() there is:
db_add_field('radioactivity_decay_profile', 'enable_decay', array(
'type' => 'int',
'not null' => TRUE,
'default' => '1',
'description' => 'Is the energy decay active',
));
But there is no radioactivity_decay_profile table on the D6 site?

CommentFileSizeAuthor
#5 radioactivity_upgrade.patch6.85 KBquicksketch
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

boran’s picture

A quick fix was to create the table as follows and run the upgrade again:

CREATE TABLE `radioactivity_decay_profile` (
  `machine_name` varchar(128) NOT NULL COMMENT 'Machine name for the profile',
  `name` varchar(128) NOT NULL COMMENT 'Name for the profile',
  `description` text COMMENT 'Description',
  `granularity` varchar(128) NOT NULL DEFAULT '60' COMMENT 'Accuracy of the modelling',
  `half_life` int(10) unsigned NOT NULL DEFAULT '21600' COMMENT 'Half life',
  `cut_off` double NOT NULL DEFAULT '0.1' COMMENT 'Cut off',
  `storage` varchar(128) NOT NULL DEFAULT 'live' COMMENT 'Storage type for the profile',
  PRIMARY KEY (`machine_name`)
) COMMENT='Radioactivity decay profiles';
tcmug’s picture

Status: Active » Closed (won't fix)

Sorry to tell you that there is no upgrade path from versions 1.x to 2.x.

Luckily we're not dealing with hugely important data (just ordering) so I hope that is not an issue :)

KarenS’s picture

Status: Closed (won't fix) » Active

Since it is not self-evident that you have to do something manual to upgrade from D6 to D7, and since the lack of those tables creates a scary upgrade error message, it would nice to at least note this on the project page instead of having this only revealed in an old, closed issue. It would be even nicer to just provide a proper upgrade path that creates the tables.

quicksketch’s picture

The very least, could *some* update be added that cleans up the D6 version and makes an empty table for the D7 version? The loss of all radio activity data is also quite depressing, considering a site with 200,000 pieces of content, that's a lot of lost data. :(

quicksketch’s picture

Status: Active » Needs review
FileSize
6.85 KB

Here's an upgrade path that upgrades all nodes and users. It doesn't deal with radioactivity on comments (not sure how common that was), but it does the following:

- Upgrades all the radioactivity profiles.
- Creates a default "field_radioactivity" field and assigns it to all types of content that has any previous radioactivity.
- Migrates all the previous radioactivity to the new field.
- Drops the old database tables.

I'm also not sure what the "radioactivity_node_clicks" table did in Drupal 6, since it's empty in my database. Does this data also need to be upgraded? And if it did, where would it go?

quicksketch’s picture

Title: D6>7 upgrade: DatabaseSchemaObjectDoesNotExistException: Cannot add field radioactivity_decay_profile » Add Drupal 7 Upgrade Path (DatabaseSchemaObjectDoesNotExistException: Cannot add field radioactivity_decay_profile)

Improving title for clarity.

yan’s picture

Issue summary: View changes

Patch from #6 works for me! (in combination with patch from #2293093: EntityMalformedException on cron runs)

yan’s picture

Status: Needs review » Needs work

Well, I think it still doesn't work correctly. There are no errors during the upgrade anymore. But the field has no values - the table field_data_field_radioactivity is empty.