-- -- -- Update an existing OTRS database from 1.1 to 1.2 -- Copyright (C) 2001-2006 OTRS GmbH, http://otrs.org/ -- -- -- $Id: DBUpdate-to-1.2.mysql.sql,v 1.18 2006/10/03 14:34:47 mh Exp $ -- -- -- -- usage: cat DBUpdate-to-1.1.mysql.sql | mysql -f -u root otrs -- -- -- -- -- new ticket history stuff -- INSERT INTO ticket_history_type (name, valid_id, create_by, create_time, change_by, change_time) VALUES ('EmailAgent', 1, 1, current_timestamp, 1, current_timestamp); INSERT INTO ticket_history_type (name, valid_id, create_by, create_time, change_by, change_time) VALUES ('EmailCustomer', 1, 1, current_timestamp, 1, current_timestamp); INSERT INTO ticket_history_type (name, valid_id, create_by, create_time, change_by, change_time) VALUES ('WebRequestCustomer', 1, 1, current_timestamp, 1, current_timestamp); -- -- for new user serach profiles -- CREATE TABLE search_profile ( login varchar (200) NOT NULL, profile_name varchar (200) NOT NULL, profile_key varchar (200) NOT NULL, profile_value varchar (200) NOT NULL ); -- -- ticket link table -- CREATE TABLE ticket_link ( ticket_id_master BIGINT NOT NULL, ticket_id_slave BIGINT NOT NULL ); -- -- add move/create/owner/priority/... options to group_user table -- ALTER TABLE group_user ADD permission_key VARCHAR (20); ALTER TABLE group_user ADD permission_value SMALLINT NOT NULL; UPDATE group_user SET permission_key = 'ro', permission_value = 1 WHERE permission_read = 1; UPDATE group_user SET permission_key = 'rw', permission_value = 1 WHERE permission_write = 1; UPDATE group_user SET permission_key = 'rw', permission_value = 1 WHERE permission_write = 0 and permission_read = 0; ALTER TABLE group_user DROP permission_read; ALTER TABLE group_user DROP permission_write; -- -- create customer user <-> group relation -- CREATE TABLE group_customer_user ( user_id VARCHAR (40) NOT NULL, group_id INTEGER NOT NULL, permission_key VARCHAR (20), permission_value SMALLINT NOT NULL, create_time DATETIME NOT NULL, create_by INTEGER NOT NULL, change_time DATETIME NOT NULL, change_by INTEGER NOT NULL ); -- -- add more free text col. to ticket table -- ALTER TABLE ticket ADD freekey3 VARCHAR (80); ALTER TABLE ticket ADD freetext3 VARCHAR (150); ALTER TABLE ticket ADD freekey4 VARCHAR (80); ALTER TABLE ticket ADD freetext4 VARCHAR (150); ALTER TABLE ticket ADD freekey5 VARCHAR (80); ALTER TABLE ticket ADD freetext5 VARCHAR (150); ALTER TABLE ticket ADD freekey6 VARCHAR (80); ALTER TABLE ticket ADD freetext6 VARCHAR (150); ALTER TABLE ticket ADD freekey7 VARCHAR (80); ALTER TABLE ticket ADD freetext7 VARCHAR (150); ALTER TABLE ticket ADD freekey8 VARCHAR (80); ALTER TABLE ticket ADD freetext8 VARCHAR (150); -- -- faq stuff -- INSERT INTO groups (name, valid_id, create_by, create_time, change_by, change_time) VALUES ('faq', 1, 1, current_timestamp, 1, current_timestamp); CREATE TABLE faq_item ( id INTEGER NOT NULL AUTO_INCREMENT, f_name VARCHAR (200) NOT NULL, f_language_id SMALLINT NOT NULL, f_subject VARCHAR (200), state_id SMALLINT NOT NULL, category_id SMALLINT NOT NULL, f_keywords MEDIUMTEXT, f_field1 MEDIUMTEXT, f_field2 MEDIUMTEXT, f_field3 MEDIUMTEXT, f_field4 MEDIUMTEXT, f_field5 MEDIUMTEXT, f_field6 MEDIUMTEXT, free_key1 VARCHAR (80), free_value1 VARCHAR (200), free_key2 VARCHAR (80), free_value2 VARCHAR (200), free_key3 VARCHAR (80), free_value3 VARCHAR (200), free_key4 VARCHAR (80), free_value4 VARCHAR (200), create_time DATETIME NOT NULL, create_by INTEGER NOT NULL, change_time DATETIME NOT NULL, change_by INTEGER NOT NULL, PRIMARY KEY(id), UNIQUE (f_name) ); CREATE TABLE faq_language ( id SMALLINT NOT NULL AUTO_INCREMENT, name VARCHAR (200) NOT NULL, PRIMARY KEY(id), UNIQUE (name) ); CREATE TABLE faq_history ( id BIGINT NOT NULL AUTO_INCREMENT, name VARCHAR (200) NOT NULL, item_id INTEGER NOT NULL, create_time DATETIME NOT NULL, create_by INTEGER NOT NULL, change_time DATETIME NOT NULL, change_by INTEGER NOT NULL, PRIMARY KEY(id) ); CREATE TABLE faq_category ( id SMALLINT NOT NULL AUTO_INCREMENT, name VARCHAR (200) NOT NULL, comments VARCHAR (220) NOT NULL, create_time DATETIME NOT NULL, create_by INTEGER NOT NULL, change_time DATETIME NOT NULL, change_by INTEGER NOT NULL, PRIMARY KEY(id), UNIQUE (name) ); CREATE TABLE faq_state ( id SMALLINT NOT NULL AUTO_INCREMENT, name VARCHAR (200) NOT NULL, type_id SMALLINT NOT NULL, PRIMARY KEY(id), UNIQUE (name) ); CREATE TABLE faq_state_type ( id SMALLINT NOT NULL AUTO_INCREMENT, name VARCHAR (200) NOT NULL, PRIMARY KEY(id), UNIQUE (name) ); INSERT INTO faq_item (f_name, f_language_id, f_subject, state_id, category_id, f_field1, f_field2, f_field3, create_time, create_by, change_time, change_by) VALUES ('welcome', 1, 'Welcome!', 1, 1, 'symptom...', 'problem...', 'solution...', current_timestamp, 1, current_timestamp, 1); INSERT INTO faq_history (name, item_id, create_time, create_by, change_time, change_by) VALUES ('Created', 1, current_timestamp, 1, current_timestamp, 1); INSERT INTO faq_language (name) VALUES ('en'); INSERT INTO faq_language (name) VALUES ('de'); INSERT INTO faq_language (name) VALUES ('es'); INSERT INTO faq_language (name) VALUES ('fr'); INSERT INTO faq_category (name, comments, create_time, create_by, change_time, change_by) VALUES ('all', 'default category', current_timestamp, 1, current_timestamp, 1); INSERT INTO faq_state (name, type_id) VALUES ('internal (agent)', 1); INSERT INTO faq_state (name, type_id) VALUES ('external (customer)', 2); INSERT INTO faq_state (name, type_id) VALUES ('public (all)', 3); INSERT INTO faq_state_type (name) VALUES ('internal'); INSERT INTO faq_state_type (name) VALUES ('external'); INSERT INTO faq_state_type (name) VALUES ('public'); -- -- auto_response update -- ALTER TABLE auto_response ADD charset VARCHAR (80) NOT NULL; UPDATE auto_response SET charset = 'ISO-8859-1' WHERE charset = ''; -- -- agent notifications -- CREATE TABLE notifications ( id INTEGER NOT NULL AUTO_INCREMENT, notification_type varchar (200) NOT NULL, notification_charset varchar (60) NOT NULL, notification_language varchar (60) NOT NULL, subject varchar (250) NOT NULL, text MEDIUMTEXT NOT NULL, create_time DATETIME NOT NULL, create_by integer NOT NULL, change_time DATETIME NOT NULL, change_by integer NOT NULL, PRIMARY KEY(id) ); INSERT INTO notifications (notification_type, notification_charset, notification_language, subject, text, create_time, create_by, change_time, change_by) VALUES ('Agent::NewTicket', 'iso-8859-1', 'en', 'New ticket notification! ()', 'Hi , there is a new ticket in ""! wrote: :///index.pl?Action=AgentZoom&TicketID= Your OTRS Notification Master', current_timestamp, 1, current_timestamp, 1); INSERT INTO notifications (notification_type, notification_charset, notification_language, subject, text, create_time, create_by, change_time, change_by) VALUES ('Agent::FollowUp', 'iso-8859-1', 'en', 'You got follow up! ()', 'Hi , you got a follow up! wrote: :///index.pl?Action=AgentZoom&TicketID= Your OTRS Notification Master', current_timestamp, 1, current_timestamp, 1); INSERT INTO notifications (notification_type, notification_charset, notification_language, subject, text, create_time, create_by, change_time, change_by) VALUES ('Agent::LockTimeout', 'iso-8859-1', 'en', 'Lock Timeout! ()', 'Hi , unlocked (lock timeout) your locked ticket []. wrote: :///index.pl?Action=AgentZoom&TicketID= Your OTRS Notification Master', current_timestamp, 1, current_timestamp, 1); INSERT INTO notifications (notification_type, notification_charset, notification_language, subject, text, create_time, create_by, change_time, change_by) VALUES ('Agent::OwnerUpdate', 'iso-8859-1', 'en', 'Ticket assigned to you! ()', 'Hi , a ticket [] is assigned to you by " ". Comment: :///index.pl?Action=AgentZoom&TicketID= Your OTRS Notification Master', current_timestamp, 1, current_timestamp, 1); INSERT INTO notifications (notification_type, notification_charset, notification_language, subject, text, create_time, create_by, change_time, change_by) VALUES ('Agent::AddNote', 'iso-8859-1', 'en', 'New note! ()', 'Hi , " " added a new note to ticket []. Note: :///index.pl?Action=AgentZoom&TicketID= Your OTRS Notification Master', current_timestamp, 1, current_timestamp, 1); INSERT INTO notifications (notification_type, notification_charset, notification_language, subject, text, create_time, create_by, change_time, change_by) VALUES ('Agent::Move', 'iso-8859-1', 'en', 'Moved ticket in "" queue! ()', 'Hi, " " moved a ticket [] into "". :///index.pl?Action=AgentZoom&TicketID= Your OTRS Notification Master', current_timestamp, 1, current_timestamp, 1); INSERT INTO notifications (notification_type, notification_charset, notification_language, subject, text, create_time, create_by, change_time, change_by) VALUES ('Agent::PendingReminder', 'iso-8859-1', 'en', 'Ticket Reminder!', 'Hi , the ticket "" has reached the reminder time! wrote: Please have a look at: :///index.pl?Action=AgentZoom&TicketID= Your OTRS Notification Master', current_timestamp, 1, current_timestamp, 1); INSERT INTO notifications (notification_type, notification_charset, notification_language, subject, text, create_time, create_by, change_time, change_by) VALUES ('Agent::Escalation', 'iso-8859-1', 'en', 'Ticket Escalation!', 'Hi , the ticket "" is escalated! wrote: Please have a look at: :///index.pl?Action=AgentZoom&TicketID= Your OTRS Notification Master', current_timestamp, 1, current_timestamp, 1); INSERT INTO notifications (notification_type, notification_charset, notification_language, subject, text, create_time, create_by, change_time, change_by) VALUES ('Agent::NewTicket', 'iso-8859-1', 'de', 'Neues Ticket! ()', 'Hi , es ist ein neues Ticket in ""! schrieb: :///index.pl?Action=AgentZoom&TicketID= Dein OTRS Benachrichiguns-Master', current_timestamp, 1, current_timestamp, 1); INSERT INTO notifications (notification_type, notification_charset, notification_language, subject, text, create_time, create_by, change_time, change_by) VALUES ('Agent::FollowUp', 'iso-8859-1', 'de', 'Nachfrage! ()', 'Hi , Du hast eine Nachfrage bekommen! schrieb: :///index.pl?Action=AgentZoom&TicketID= Dein OTRS Benachrichiguns-Master', current_timestamp, 1, current_timestamp, 1); INSERT INTO notifications (notification_type, notification_charset, notification_language, subject, text, create_time, create_by, change_time, change_by) VALUES ('Agent::LockTimeout', 'iso-8859-1', 'de', 'Lock Timeout! ()', 'Hi , aufhebung der Sperre auf Dein gesperrtes Ticket []. schrieb: :///index.pl?Action=AgentZoom&TicketID= Dein OTRS Benachrichiguns-Master', current_timestamp, 1, current_timestamp, 1); INSERT INTO notifications (notification_type, notification_charset, notification_language, subject, text, create_time, create_by, change_time, change_by) VALUES ('Agent::OwnerUpdate', 'iso-8859-1', 'de', 'Ticket uebertragen an Dich! ()', 'Hi , ein Ticket [] wurde an Dich von " " uebertragen. Kommentar: :///index.pl?Action=AgentZoom&TicketID= Dein OTRS Benachrichiguns-Master', current_timestamp, 1, current_timestamp, 1); INSERT INTO notifications (notification_type, notification_charset, notification_language, subject, text, create_time, create_by, change_time, change_by) VALUES ('Agent::AddNote', 'iso-8859-1', 'de', 'Neue Notiz! ()', 'Hi , " " fuegte eine Notiz an Ticket []. Notiz: :///index.pl?Action=AgentZoom&TicketID= Dein OTRS Benachrichiguns-Master', current_timestamp, 1, current_timestamp, 1); INSERT INTO notifications (notification_type, notification_charset, notification_language, subject, text, create_time, create_by, change_time, change_by) VALUES ('Agent::Move', 'iso-8859-1', 'de', 'Ticket verschoben in "" Queue! ()', 'Hi , " " verschob Ticket [] nach "". :///index.pl?Action=AgentZoom&TicketID= Dein OTRS Benachrichiguns-Master', current_timestamp, 1, current_timestamp, 1); INSERT INTO notifications (notification_type, notification_charset, notification_language, subject, text, create_time, create_by, change_time, change_by) VALUES ('Agent::PendingReminder', 'iso-8859-1', 'de', 'Ticket Erinnerung!', 'Hi , das Ticket "" hat die Erinnerungszeit erreicht! schrieb: Bitte um weitere Bearbeutung: :///index.pl?Action=AgentZoom&TicketID= Dein OTRS Benachrichiguns-Master', current_timestamp, 1, current_timestamp, 1); INSERT INTO notifications (notification_type, notification_charset, notification_language, subject, text, create_time, create_by, change_time, change_by) VALUES ('Agent::Escalation', 'iso-8859-1', 'de', 'Ticket Eskalation!', 'Hi , das Ticket "" ist eskaliert! Bitte um Bearbeutung: schrieb: :///index.pl?Action=AgentZoom&TicketID= Dein OTRS Benachrichiguns-Master', current_timestamp, 1, current_timestamp, 1); -- -- rename comment to comments column -- ALTER TABLE groups CHANGE comment comments VARCHAR (250); ALTER TABLE charset CHANGE comment comments VARCHAR (250); ALTER TABLE ticket_state CHANGE comment comments VARCHAR (250); ALTER TABLE ticket_state_type CHANGE comment comments VARCHAR (250); ALTER TABLE salutation CHANGE comment comments VARCHAR (250); ALTER TABLE signature CHANGE comment comments VARCHAR (250); ALTER TABLE system_address CHANGE comment comments VARCHAR (200); ALTER TABLE follow_up_possible CHANGE comment comments VARCHAR (200); ALTER TABLE queue CHANGE comment comments VARCHAR (200); ALTER TABLE ticket_history_type CHANGE comment comments VARCHAR (250); ALTER TABLE article_type CHANGE comment comments VARCHAR (250); ALTER TABLE article_sender_type CHANGE comment comments VARCHAR (250); ALTER TABLE standard_response CHANGE comment comments VARCHAR (80); ALTER TABLE auto_response_type CHANGE comment comments VARCHAR (80); ALTER TABLE auto_response CHANGE comment comments VARCHAR (80); ALTER TABLE customer_user CHANGE comment comments VARCHAR (250); ALTER TABLE standard_attachment CHANGE comment comments VARCHAR (150); ALTER TABLE pop3_account CHANGE comment comments VARCHAR (250);