PDA

View Full Version : DB Error #1054 when upgrading


darylt
08-15-2009, 11:06 AM
I upgraded to the latest version and was emailed three emails all tiltled DB Error #1054

[SELECT count(open.ticket_id) as open, count(answered.ticket_id) as answered ,count(overdue.ticket_id) as overdue, count(assigned.ticket_id) as assigned FROM ost_ticket ticket LEFT JOIN ost_ticket open ON open.ticket_id=ticket.ticket_id AND open.status='Open' AND open.isanswered=0 LEFT JOIN ost_ticket answered ON answered.ticket_id=ticket.ticket_id AND answered.status='Open' AND answered.isanswered=1 LEFT JOIN ost_ticket overdue ON overdue.ticket_id=ticket.ticket_id AND overdue.status='Open' AND overdue.isoverdue=1 LEFT JOIN ost_ticket assigned ON assigned.ticket_id=ticket.ticket_id AND assigned.staff_id=1]

Unknown column 'open.isanswered' in 'on clause'


[SELECT count(DISTINCT ticket.ticket_id) FROM ost_ticket ticket LEFT JOIN ost_department dept ON ticket.dept_id=dept.dept_id WHERE 1 AND status='open' AND isanswered=0 ]

Unknown column 'isanswered' in 'where clause'

[SELECT DISTINCT ticket.ticket_id,lock_id,ticketID,ticket.dept_id,t icket.staff_id,subject,name,email,dept_name ,ticket.status,ticket.source,isoverdue,isanswered, ticket.created,pri.* ,count(attach.attach_id) as attachments ,count(attach.attach_id) as attachments FROM ost_ticket ticket LEFT JOIN ost_department dept ON ticket.dept_id=dept.dept_id LEFT JOIN ost_ticket_priority pri ON ticket.priority_id=pri.priority_id LEFT JOIN ost_ticket_lock tlock ON ticket.ticket_id=tlock.ticket_id AND tlock.expire>NOW() LEFT JOIN ost_ticket_attachment attach ON ticket.ticket_id=attach.ticket_id WHERE 1 AND status='open' AND isanswered=0 GROUP BY ticket.ticket_id ORDER BY priority_urgency,ticket.created DESC LIMIT 0,25]

Unknown column 'isanswered' in 'field list'

scottro
08-19-2009, 10:08 AM
Sounds like your database is missing the "isanswered" field.

darylt
08-19-2009, 10:27 AM
I have just had a look in my database and have found the isanswered field under ost_ticket

scottro
08-19-2009, 10:52 AM
I saw some similar issues on google but those were all with updates and inserts. This is merely getting information, its basically saying that it doesn't find it.

I also read that someone noticed a bug and their solution was to change the order of where the column was found. What is the order/structure of your ost_ticket table?

Mine (working) is:

ticket_id
ticketID
dept_id
priority_id
staff_id
email
name
subject
topic
phone
phone_ext
ip_address
status
source
isoverdue
isanswered
duedate
reopened
closed
lastmessage
lastresponse
created
updated

It looks like all of our code is the same too, FWIW.

darylt
08-19-2009, 11:20 AM
Mine is;

ticket_id
ticketID
dept_id
priority_id
staff_id
email
name
subject
topic
phone
phone_ext
ip_address
status
source
isoverdue
isanswered
duedate
reopened
closed
lastmessage
lastresponse
created
updated

Is there some sort of script that I can run to test it - maybe it was just having a bad day? lol

peter
08-19-2009, 11:28 AM
The emailed errors are expected during the upgrade process, if you access staff panel before the upgrade is completed.

scottro
08-19-2009, 04:20 PM
Ah, cool. I was starting to be at a loss. (Mostly where I was when I started) ;)