Skip to content
Snippets Groups Projects
Commit 040fe360 authored by Jared Hancock's avatar Jared Hancock
Browse files

streams: core: Delete junk records before adding PK

Delete junk records from the %ticket_email_info table before adding a
primary key. Since there was previously no PK, there could be duplicate
records.
parent bd8aa480
No related branches found
No related tags found
No related merge requests found
...@@ -15,6 +15,10 @@ UPDATE `%TABLE_PREFIX%filter_rule` ...@@ -15,6 +15,10 @@ UPDATE `%TABLE_PREFIX%filter_rule`
SET `how` = 'equal' WHERE `how` IS NULL; SET `how` = 'equal' WHERE `how` IS NULL;
-- [#331](https://github.com/osTicket/osTicket-1.8/issues/331) -- [#331](https://github.com/osTicket/osTicket-1.8/issues/331)
-- Previously there was no primary key on the %ticket_email_info table, so
-- clean up any junk records before adding one
DELETE FROM `%TABLE_PREFIX%ticket_email_info` WHERE
`message_id` = 0 OR `message_id` IS NULL;
ALTER TABLE `%TABLE_PREFIX%ticket_email_info` ALTER TABLE `%TABLE_PREFIX%ticket_email_info`
CHANGE `message_id` `thread_id` int(11) unsigned NOT NULL, CHANGE `message_id` `thread_id` int(11) unsigned NOT NULL,
ADD PRIMARY KEY (`thread_id`), ADD PRIMARY KEY (`thread_id`),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment