Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hi,
I have recently updated from Drupal core 7.0 to Drupal core 7.2, then ran a update.php script where I discovered that this update needs several database changes, unfortunately two of them did not run smoothly. They are "comment module 7008 - Update database to match Drupal 7 schema." and "user module 7016 - Update the database to match the schema." with error messages:
The following updates returned messages
user module
Update #7016
Failed: PDOException: SQLSTATE[42000]: [Microsoft][SQL Server Native Client 10.0][SQL Server]An explicit DROP INDEX is not allowed on index 'users.users_pkey'. It is being used for PRIMARY KEY constraint enforcement.: DROP INDEX [users_pkey] ON [{users}]; Array ( ) in function db_change_field() (row: 2944 in file C:\inetpub\web\SITE\drupal\includes\database\database.inc).
comment module
Update #7008
Failed: PDOException: SQLSTATE[42000]: [Microsoft][SQL Server Native Client 10.0][SQL Server]Object 'comment.status' cannot be renamed because the object participates in enforced dependencies.: EXEC sp_rename :old, :new, :type; Array ( [:old] => comment.status [:new] => status_old [:type] => COLUMN ) in function db_change_field() (row: 2944 in file C:\inetpub\web\SITE\drupal\includes\database\database.inc).
Thanks for looking at it.
Comments
Comment #1
Damien Tournoud CreditAttribution: Damien Tournoud commentedJust triaging for now.
Comment #2
Damien Tournoud CreditAttribution: Damien Tournoud commentedThose are two different issues:
user_update_7016()
modifies a primary key and we don't properly account for this casecomment_update_7008()
modifies an unsigned column, and for some reason we fail to drop the related constraint before renaming the columnComment #3
Damien Tournoud CreditAttribution: Damien Tournoud commentedThis is now fixed by e230b9, bb7f5b and 0a86de. Tests are in fcd1d5.
Comment #4
goldramgb CreditAttribution: goldramgb commentedCan someone give some direction to a total newbie to drupal. I have the same error when I did the upgrade, I found this Issue and downloaded the patch but it readme.txt points to the web site for installation instructions but looks like that is for a new installation. I'm sure this update is easy for someone that knows how to do it, but for me it makes no sense.
Comment #5
Erythros CreditAttribution: Erythros commentedThe best way will be to just delete the old module (even folder in includes/database), download the module from drupal.org/project/sqlsrv and copy to module and database folders as is written in help txt.
Of course, thanks for patching the module.
Comment #6
goldramgb CreditAttribution: goldramgb commentedErythros Thanks for the reply. As far as I can tell I don't have a SQLSRV.module installed. I did replace the old files in the includes/database folder with the new ones, but I just got an error( I didn't write it down though) I replaces the new files with the old file and the web site started working again. But now if I try to clear the caches I get the following error.
PDOException: SQLSTATE[23000]: [Microsoft][SQL Server Native Client 10.0][SQL Server]Violation of PRIMARY KEY constraint 'registry_pkey'. Cannot insert duplicate key in object 'dbo.registry'. in _registry_parse_file() (line 179 of C:\Drupal\tscobb\includes\registry.inc).
I looked but couldn't fine a help txt anywhere, did I miss it? In the readme that was in the download it just gave the URL for the web site.
Should I install a new module with the .module file from the download, and replace the old files from the includes/database folder?
Thanks for your time. Bill