In 5.x-1.x, content_install() creates the 'required' and 'multiple' columns in the node_field table, and content_update_3() adds the 'db_storage' column:
required int NOT NULL default '0',
multiple int NOT NULL default '0',
db_storage int NOT NULL default 0
In 6.x-2.x, the schema sets these columns as tinyints, and the default value for db_storage has been changed to 1:
'required' => array('type' => 'int', 'size' => 'tiny', 'not null' => TRUE, 'default' => 0),
'multiple' => array('type' => 'int', 'size' => 'tiny', 'not null' => TRUE, 'default' => 0),
'db_storage' => array('type' => 'int', 'size' => 'tiny', 'not null' => TRUE, 'default' => 1),
Schema module reports this mis-match as:
* content_node_field
* column required - difference on: size
declared: array('description' => t('TODO: please describe this field!'), 'type' => 'int', 'size' => 'tiny', 'not null' => TRUE, 'default' => 0)
actual: array('description' => t('TODO: please describe this field!'), 'type' => 'int', 'not null' => TRUE, 'default' => 0)
* column multiple - difference on: size
declared: array('description' => t('TODO: please describe this field!'), 'type' => 'int', 'size' => 'tiny', 'not null' => TRUE, 'default' => 0)
actual: array('description' => t('TODO: please describe this field!'), 'type' => 'int', 'not null' => TRUE, 'default' => 0)
* column db_storage - differences on: size, default
declared: array('description' => t('TODO: please describe this field!'), 'type' => 'int', 'size' => 'tiny', 'not null' => TRUE, 'default' => 1)
actual: array('description' => t('TODO: please describe this field!'), 'type' => 'int', 'not null' => TRUE, 'default' => 0)
A new content_update_60xx() to re-set these attributes would sort this out.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | cck-642190.patch | 2.83 KB | jweowu |
Comments
Comment #1
jweowu commentedIn addition to the above, I've found that nodereference field tables from Drupal 5 have a signed column which should be unsigned.
e.g.:
With Drupal 5 now unsupported, there will be plenty of people upgrading from Drupal 5. It would be good to get these discrepancies sorted out.
Patch attached.
Comment #2
karens commentedClarifying this report. No one has time to spend on D5 these days, especially fixes to an old upgrade path that was always problematic. This is why it is better not to wait so long to upgrade :(
Leaving this here in case someone else wants to tackle it, but I have no time to do it.
Comment #3
karens commentedAlso, as written this would run not only for sites trying to upgrade from D5 to D6 but also for all of the other 250,000 sites already using D6, potentially breaking them. So this is also 'Needs work'.
Comment #4
jweowu commentedOn that last point, remember that a great many of those Drupal 6 sites would have started as Drupal 5 sites, and therefore would currently exhibit these issues. This isn't just for the sites which have yet to upgrade; it's a fix for all Drupal 6 sites which do not have the database schema that CCK thinks they do.
(Is there even a way to programmatically determine the upgrade history of a Drupal site?)