I tried to do a new install, but this time i didn't create the database by hand. And the module crashed because it was looking for prefixed tables ...but they were created unprefixed :(
That's fixed now with this patch.
I took the oportunity to replace all the ugly INT(10) by INT: for portability issue we must avoid the use precision with INT, SMALLINT, TINYINT...
Still for portability, Drupal golden rule is to avoid auto-numbered fields and use it's own sequence function db_next_id($sequence_name). The trick is used for {quiz_result}.rid :) But not for {quiz_question_answer}.aid witch is declared as AUTO_INCREMENT :(
Not fixed : waiting for the code that use it (i think within quiz.module) to be corrected before.
Also, MySQL tables shouldn't be declared MyISAM! Some people are not using that engine with Drupal; they prefer InnoDB for example..
Fixed.
Also avoid default INDEX names and provide explicit ones, otherwise it can hurt when restoring a table/database dump..
Fixed.
Last thing: never trust the database default behaviour; it's not portable. So one should always provide own DEFAULT values, specially when columns are NOT NULL.
Not fixed: checks are performed by the code in the module.
Begun: Posgres support :)
Added: Uninstall hook :)
I had a question, but can't remember. Maybe later. :/
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | quiz_installer.patch | 11.48 KB | seanbfuller |
| #4 | prefix_serials.patch | 1.81 KB | gilcot |
| #3 | install.patch_0.txt | 10.48 KB | gilcot |
| install.patch.txt | 9.04 KB | gilcot |
Comments
Comment #1
seanbfuller commentedGood catches. I'll try to take a crack at testing it soon, but I'm pretty snowed under right now. If you are looking to take another pass at it, just let me know when you're ready and I'll test and commit.
Comment #2
gilcot commentedcatched! :))
like here (in
quiz.module):there should be (in
multichoice.module@hook_update()&hook_insert()):or shorter (in
multichoice.module@hook_update()&hook_insert()):but not (still in
multichoice.module@hook_update()&hook_insert()):patches (patch for module and final install) coming as soon as possible.
Comment #3
gilcot commentedjob done: here is the patch.
Comment #4
gilcot commentedit's related to prefixing http://drupal.org/node/90325 :)
what's the problem then? in a multi-site installation, the keys conflict... they should be per table; prefixed then.
but i post it here because it should have been done here (this patch should be after the previous one).
Comment #5
seanbfuller commentedCommitted to head.
Attached is a combined patch with one small change: I changed {quiz_results_rid} to {quiz_results}_rid. Minor change, but this seemed to be how node.module was doing it. Seems to make sense, since it is the table that you want to match up with the prefix.
Comment #6
(not verified) commented