Version of script: 3.1.2
What terms did you try when SEARCHING for a solution: Database structure
Write your message below:
Is there a function/script to validate my database structure? One of my HESK databases seems to be missing fields.
I run 2 HESK installations, both licensed, both on version 3.1.2, the newest started on version 3.1.1 (here in 2020), and the old one started on version 2.5.3 (in 2014) and have therefore been updated many times.
The "team users" of the oldest HESK installation, noticed today that the "Create new ticket" button under the admin section did not work anymore, it failed with an SQL error, on the following statement:
SELECT `id`, `name`, `priority` FROM `hesk_categories` ORDER BY `cat_order` ASC
It worked fine on the young installation, so I looked in the database, and discovered that the "priority" field in that table where missing on the old installation, I created the field as in the other, and now the "Create new ticket" works fine again.
I looked quick in the database and can see that in the table hesk_attachments the field "type" is also missing on the old installation, so are there any more fields that are missing from the old installaion? They do not use heskdesk, so it is possible that missing fields are not used.
Is there a way I can validate the structure in the database for missing fields?
Thanks in advance.
(SOLVED) Database structure validation
Moderator: mkoch227
(SOLVED) Database structure validation
Last edited by shadedk on Thu Oct 15, 2020 2:04 pm, edited 1 time in total.
Re: Database structure validation
This usually happens when someone uploads the new files, but doesn't run the install/update script which takes care of database updates. Or if someone restores an old (incompatible) database backup.
What I would do is:
What I would do is:
- Backup files and database
- Remove the changes you manually made to the database
- Upload "install" folder from Hesk 3.1.2
- Open hesk/install and click the "Update" option
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here 
You should follow me on Twitter here
Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...
Also browse for php hosting companies, read php books, find php resources and use webmaster tools


Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...
Also browse for php hosting companies, read php books, find php resources and use webmaster tools
Re: Database structure validation
I am quite sure that the database allways have been updated together with new files, but i the early days of Hesk we did not update every often so mabee a big jump in version did this. But nevermind that.
I tried the update and it did not fix it, so i manually compare our old Hesk installation with the new one and fixed the structure. So it is fine now
I tried the update and it did not fix it, so i manually compare our old Hesk installation with the new one and fixed the structure. So it is fine now

Re: (SOLVED) Database structure validation
What version did you upgrade from?
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here 
You should follow me on Twitter here
Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...
Also browse for php hosting companies, read php books, find php resources and use webmaster tools


Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...
Also browse for php hosting companies, read php books, find php resources and use webmaster tools
Re: (SOLVED) Database structure validation
This time from 3.1.1 to 3.1.2, but before 2.8 updates has not been apllied very often.