Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SQL error after installing plugin (2018) #62

Open
jthakilla9 opened this issue Dec 20, 2018 · 0 comments
Open

SQL error after installing plugin (2018) #62

jthakilla9 opened this issue Dec 20, 2018 · 0 comments

Comments

@jthakilla9
Copy link

Hi guyz,

How can i fix this excaly?

[ALTER TABLE ost_equipment CHANGE COLUMN name asset_id VARCHAR(255) NOT NULL , ADD COLUMN staff_id INT NULL AFTER is_active, ADD COLUMN user_id INT NULL AFTER staff_id DROP INDEX name] You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'DROP INDEX name' at line 5[CREATE TRIGGER ost_ticket_event_AINS AFTER INSERT ON ost_ticket_event FOR EACH ROW BEGIN IF NEW.state='closed' THEN SET @equipment_id = (SELECT equipment_id FROM ost_equipment_ticket WHERE ticket_id=NEW.ticket_id LIMIT 1); IF ((@equipment_id IS NOT NULL) AND (@equipment_id>0)) THEN SET @open_ticks = (SELECT COUNT(ticket_id) FROM ost_EquipmentTicketView WHERE equipment_id = @equipment_id AND status != 'closed'); IF @open_ticks = 0 THEN SET @status_id = (SELECT status_id FROM ost_equipment_status WHERE baseline=1 LIMIT 1); IF ((@status_id IS NOT NULL) AND (@status_id>0)) THEN UPDATE ost_equipment SET status_id = @status_id WHERE equipment_id = @equipment_id; END IF; END IF; END IF; ELSEIF NEW.state='created' THEN SET @status_id = (SELECT status_id FROM ost_EquipmentFormView WHERE ticket_id= NEW.ticket_id AND field_label='Status' LIMIT 1); SET @asset_id = (SELECT value FROM ost_EquipmentFormView WHERE ticket_id= NEW.ticket_id AND field_label='Asset ID' LIMIT 1); IF( @asset_id IS NULL) THEN SET @asset_id_str = (SELECT value FROM ost_EquipmentFormView WHERE ticket_id= NEW.ticket_id AND field_label='Equipment' LIMIT 1); SET @asset_id = (SELECT SUBSTRING_INDEX(@asset_id_str, 'Asset_ID:', -1)); SET @asset_id = SUBSTRING(@asset_id, 1, CHAR_LENGTH(@asset_id) - 2); END IF; SET @equipment_id = (SELECT equipment_id FROM ost_equipment WHERE asset_id= @asset_id); IF ((@status_id IS NOT NULL) AND (@status_id >0)) AND ((@equipment_id IS NOT NULL) AND (@equipment_id >0)) THEN UPDATE ost_equipment SET status_id = @status_id WHERE equipment_id=@equipment_id; INSERT INTO ost_equipment_ticket (equipment_id, ticket_id, created) VALUES (@equipment_id, NEW.ticket_id, NOW()); END IF; END IF; END] Table 'osticket.ost_ticket_event' doesn't exist
Error parsing SQL schema! Get help from developers (#4)
Upgrade configuration error. Unable to upgrade database tables!

I get this error after enable the plugin.

This is my current versions:

Server Information

osTicket Version | v1.10.4 (035fd0a) —  Up to date
Web Server Software | Apache/2.4.34 (Win32) OpenSSL/1.0.2o PHP/5.6.38
MySQL Version | 10.1.36
PHP Version | 5.6.38

I made a new ticket on purpose, cuzz the other tickets with similar problems are old.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant