nethesis / dev

Nethesis issue tracker
http://www.nethesis.it
4 stars 1 forks source link

NethVoice Report: CREATE TABLE field name doesn't match INSERT field name #6195

Closed andrea-marchionni closed 1 year ago

andrea-marchionni commented 1 year ago

Running cron script I have an error

/opt/nethvoice-report/tasks/tasks views
[ERROR]: FATAL: Error reading views directory: Error in query execution: /opt/nethvoice-report/api/views/data_call.sql: Error 1054: Unknown column 'recall_time' in 'field list

it seems to be caused by a mismatch in

/opt/nethvoice-report/api/views/data_call.sql

where CREATE command is

CREATE TABLE IF NOT EXISTS data_call
(UNIQUE KEY \`period\` (\`period\`,\`cid\`,\`qname\`))
SELECT
    DATE_FORMAT(
        FROM_UNIXTIME(`timestamp_in`),
        '%Y-%m-%d %H:%i:%s'
    ) AS period,
    IF (report_queue.cid IS NOT NULL,report_queue.cid,"") AS cid,
    qname,
    qdescr,
    agent,
    agents,
    position,
    hold AS hold,
    duration AS duration,
    ACTION AS result,
    IF(data4 > 0, 'YES', 'NO') AS recalled,
    data4 AS recallTime
FROM
    report_queue
GROUP BY period, report_queue.cid, qname
ORDER BY
    period;

and INSERT command

INSERT IGNORE INTO data_call ( \`period\`, \`cid\`, \`qname\`, \`qdescr\`, \`agent\`, \`agents\`, \`position\`, \`hold\`, \`duration\`, \`result\`, \`recalled\`, \`recall_time\`)

The same field is named recallTime in the CREATE command and recall_time in the INSERT command.

nethbot commented 1 year ago

in 7.9.2009/nethesis-testing:

nethbot commented 1 year ago

in 7.9.2009/nethesis-testing:

nethbot commented 1 year ago

in 7.9.2009/nethesis-testing:

nethbot commented 1 year ago

in 7.9.2009/nethesis-testing:

nethbot commented 1 year ago

in 7.9.2009/nethesis-testing:

nethbot commented 1 year ago

in 7.9.2009/nethesis-testing:

nethbot commented 1 year ago

in 7.9.2009/nethesis-updates: