cfdp / opeka

Counseling chat service, built for providing anonymous help to young people at risk
https://curachat.com
GNU General Public License v3.0
10 stars 6 forks source link

Prepare input for db storage #83

Closed benjamin-dk closed 7 years ago

benjamin-dk commented 7 years ago

The screening questions and answers should be stored in the db but at the moment I am struggling to find the right syntax for saving the array.

19 Apr 10:43:56 - Error: Screening responses could not be saved.
/home/demo/opeka/nodejs/node_modules/mysql/lib/protocol/Parser.js:78
        throw err; // Rethrow non-MySQL errors
        ^

Error: ER_BAD_FIELD_ERROR: Unknown column 'questions' in 'field list'
    at Query.Sequence._packetToError (/home/demo/opeka/nodejs/node_modules/mysql/lib/protocol/sequences/Sequence.js:51:14)
    at Query.ErrorPacket (/home/demo/opeka/nodejs/node_modules/mysql/lib/protocol/sequences/Query.js:83:18)
    at Protocol._parsePacket (/home/demo/opeka/nodejs/node_modules/mysql/lib/protocol/Protocol.js:280:23)
    at Parser.write (/home/demo/opeka/nodejs/node_modules/mysql/lib/protocol/Parser.js:74:12)

The screening question module should be enabled,and the screeningQuestions setting should be set to true in config.json.

cfdp commented 7 years ago

Fixed with #84