node-demo
node-demo copied to clipboard
column question.questions.position is missing
squelize version 2.0.6
express:router checkQuestionModel /admin/quizzes : /admin/quizzes/1/questions/1
Possibly unhandled SequelizeDatabaseError: SQLITE_ERROR: no such column: question.questions.id
at module.exports.Query.formatError ([…]/node_modules/sequelize/lib/dialects/sqlite/query.js:245:16)
at […]/node_modules/sequelize/lib/dialects/sqlite/query.js:53:31
etc.
express:router checkQuizModel /admin/quizzes : /admin/quizzes/1/next
Hey,
Yes, I know. This is ooooold code. A rewrite is scheduled this summer, so it becomes usable again, and not just as a demo, but as a general quiz engine. Sorry! A little patience still.
Ok, for anybody interested, I've found a way to make things work...well I hope.
I know it's just a "quick" and maybe dirty fix, but at least we can make this fun example work again ;)
1/ install and use nvm to "force" the use of node 0.10.20 (see docs to install and use it)
2/ follow tdd's readme for installation
3/ change socket.io version (file package.json references latest, which obviously is not going to work !):
npm uninstall socket.io
npm install [email protected]
(maybe changing version in package.json before npm install is a better idea though...)
4/ correct app > back > questions.js at line 24 with:
req.quiz.getQuestions({ where: { 'id': questionId }, include: [Answer], order: 'answers.position' }).success(function(qs) {
5/ correct app > engine.js at line 329 with:
opts.where['position'] = { gt: this.currentQuestion.position };
This should make things usable again...at least for what I've seen so far.
Anyway, I hope tdd will find some time to rework this nice engine from the ground up ;)