I have 7.x-5.0-dev installed. This version was from a release about a month ago. I'm attempting to install the 7.x-5.0-alpha5 version, but two updates don't seem to be getting through. The updates are for the quiz_question module.

7500 - Add fields for general question feedback.
7501 - Drop table {quiz_question_latest_quizzes}.

Here is what I get after running update.php

quiz_question module

Update #7500
Failed: PDOException: SQLSTATE[42000]: Syntax error or access violation: 1075 Incorrect table definition; there can be only one auto column and it must be defined as a key: ALTER TABLE {quiz_question_properties} DROP PRIMARY KEY; Array ( ) in db_drop_primary_key() (line 2904 of /srv/bindings/website/code/includes/database/database.inc).

Comments

djdevin’s picture

Interesting, in SQL, could you do a "show create table quiz_question_properties" and paste the output?

jukka792’s picture

Hi,

Got this alert when updating from beta4 to beta5:

quiz_question module:

Update #7500
Failed: PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'mydatabasename.dr_quiz_truefalse_node' doesn't exist: UPDATE {quiz_question_properties} qqp INNER JOIN {quiz_truefalse_node} qtn ON (qtn.vid = qqp.vid) SET qqp.feedback = qtn.feedback, qqp.feedback_format = :format; Array ( [:format] => full_html ) in quiz_question_update_7500() (line 114 of /htdocs/sites/all/modules/quiz/question_types/quiz_question/quiz_question.install)

This site didn't have "true false" question type enabled.

djdevin’s picture

Can you enable the truefalse module before trying the upgrade?

Edit: just saw your last bit. Installing the module then updating might fix it.

  • djdevin committed 1b8f9e9 on 7.x-5.x
    Issue #2381531: fixed update hook not working when truefalse was not...
djdevin’s picture

Okay, I fixed quiz_question_update_7500. The next dev roll should have it upgrade successfully even if you have truefalse disabled.

If this isn't a production site, I would roll back the DB to alpha4, and 1) wait for dev, and install that, then update OR 2) install the truefalse module before updating.

If this is a production site, and you can't restore backups, you will have to manually remove the qqp_id, feedback, feedback_format fields from from "quiz_question_properties". Once you have done that, run the update again. The fields should be re-added and the updates will move on.

djdevin’s picture

Status: Active » Fixed
gratefulsk’s picture

Status: Fixed » Active

Hi djdevin. Sorry to make this active, but I'm still stuck with this error

Here is the output I get for "show create table quiz_question_properties"

CREATE TABLE `quiz_question_properties` (
 `nid` int(10) unsigned NOT NULL,
 `vid` int(10) unsigned NOT NULL,
 `max_score` int(10) unsigned DEFAULT '0',
 `qqp_id` int(11) NOT NULL AUTO_INCREMENT,
 `feedback` text,
 `feedback_format` varchar(255) DEFAULT NULL,
 PRIMARY KEY (`qqp_id`)
) ENGINE=MyISAM AUTO_INCREMENT=4175 DEFAULT CHARSET=utf8 COMMENT='Properties common for all quizzes'
djdevin’s picture

Did you try the above steps? I tried it myself and was able to get by it.

Can you roll back your database to what it was when it was alpha4, then grab the latest -dev?

Otherwise, delete the qqp_id, feedback, and feedback_format fields, then try updating again?

gratefulsk’s picture

Status: Active » Fixed

You are correct. Dropping the qqp_id, feedback, and feedback_format fields solved it. Thanks!

djdevin’s picture

Great, glad it worked out...thanks for the report!

  • djdevin committed 1b8f9e9 on 7.x-6.x
    Issue #2381531: fixed update hook not working when truefalse was not...

Status: Fixed » Closed (fixed)

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