Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
osticket
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
docker
osticket
Commits
456add95
Commit
456add95
authored
9 years ago
by
Jared Hancock
Browse files
Options
Downloads
Patches
Plain Diff
amendme: Add migration for %thread_event table
parent
478423e6
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
include/upgrader/streams/core/9143a511-00000000.patch.sql
+28
-0
28 additions, 0 deletions
include/upgrader/streams/core/9143a511-00000000.patch.sql
setup/inc/streams/core/install-mysql.sql
+10
-6
10 additions, 6 deletions
setup/inc/streams/core/install-mysql.sql
with
38 additions
and
6 deletions
include/upgrader/streams/core/9143a511-00000000.patch.sql
0 → 100644
+
28
−
0
View file @
456add95
ALTER
TABLE
`%TABLE_PREFIX%ticket_event`
ADD
`id`
int
(
10
)
unsigned
NOT
NULL
AUTO_INCREMENT
PRIMARY
KEY
FIRST
,
CHANGE
`ticket_id`
`thread_id`
int
(
11
)
unsigned
NOT
NULL
default
'0'
,
CHANGE
`staff`
`username`
varchar
(
128
)
NOT
NULL
default
'SYSTEM'
,
CHANGE
`state`
`state`
enum
(
'created'
,
'closed'
,
'reopened'
,
'assigned'
,
'transferred'
,
'overdue'
,
'edited'
,
'viewed'
,
'error'
,
'collab'
,
'resent'
)
NOT
NULL
,
ADD
`data`
varchar
(
1024
)
DEFAULT
NULL
COMMENT
'Encoded differences'
AFTER
`state`
,
ADD
`uid`
int
(
11
)
unsigned
DEFAULT
NULL
AFTER
`username`
,
ADD
`uid_type`
char
(
1
)
NOT
NULL
DEFAULT
'S'
AFTER
`uid`
,
RENAME
TO
`%TABLE_PREFIX%thread_event`
;
-- Change the `ticket_id` column to the values in `%thread`.`id`
CREATE
TABLE
`%TABLE_PREFIX%_ticket_thread_evt`
(
PRIMARY
KEY
(
`object_id`
))
SELECT
`object_id`
,
`id`
FROM
`%TABLE_PREFIX%thread`
WHERE
`object_type`
=
'T'
;
UPDATE
`%TABLE_PREFIX%thread_event`
A1
JOIN
`%TABLE_PREFIX%_ticket_thread_evt`
A2
ON
(
A1
.
`thread_id`
=
A2
.
`object_id`
)
SET
A1
.
`thread_id`
=
A2
.
`id`
;
DROP
TABLE
`%TABLE_PREFIX%_ticket_thread_evt`
;
-- Attempt to connect the `username` to the staff_id
UPDATE
`%TABLE_PREFIX%thread_event`
A1
LEFT
JOIN
`%TABLE_PREFIX%staff`
A2
ON
(
A2
.
`username`
=
A1
.
`username`
)
SET
A1
.
`uid`
=
A2
.
`staff_id`
WHERE
A1
.
`username`
!=
'SYSTEM'
;
This diff is collapsed.
Click to expand it.
setup/inc/streams/core/install-mysql.sql
+
10
−
6
View file @
456add95
...
...
@@ -712,18 +712,22 @@ CREATE TABLE `%TABLE_PREFIX%lock` (
KEY
`staff_id`
(
`staff_id`
)
)
DEFAULT
CHARSET
=
utf8
;
DROP
TABLE
IF
EXISTS
`%TABLE_PREFIX%ticket_event`
;
CREATE
TABLE
`%TABLE_PREFIX%ticket_event`
(
`ticket_id`
int
(
11
)
unsigned
NOT
NULL
default
'0'
,
DROP
TABLE
IF
EXISTS
`%TABLE_PREFIX%thread_event`
;
CREATE
TABLE
`%TABLE_PREFIX%thread_event`
(
`id`
int
(
10
)
unsigned
NOT
NULL
AUTO_INCREMENT
,
`thread_id`
int
(
11
)
unsigned
NOT
NULL
default
'0'
,
`staff_id`
int
(
11
)
unsigned
NOT
NULL
,
`team_id`
int
(
11
)
unsigned
NOT
NULL
,
`dept_id`
int
(
11
)
unsigned
NOT
NULL
,
`topic_id`
int
(
11
)
unsigned
NOT
NULL
,
`state`
enum
(
'created'
,
'closed'
,
'reopened'
,
'assigned'
,
'transferred'
,
'overdue'
)
NOT
NULL
,
`staff`
varchar
(
255
)
NOT
NULL
default
'SYSTEM'
,
`state`
enum
(
'created'
,
'closed'
,
'reopened'
,
'assigned'
,
'transferred'
,
'overdue'
,
'edited'
,
'viewed'
,
'error'
,
'collab'
,
'resent'
)
NOT
NULL
,
`data`
varchar
(
1024
)
DEFAULT
NULL
COMMENT
'Encoded differences'
,
`username`
varchar
(
128
)
NOT
NULL
default
'SYSTEM'
,
`uid`
int
(
11
)
unsigned
DEFAULT
NULL
,
`uid_type`
char
(
1
)
NOT
NULL
DEFAULT
'S'
,
`annulled`
tinyint
(
1
)
unsigned
NOT
NULL
default
'0'
,
`timestamp`
datetime
NOT
NULL
,
KEY
`ticket_state`
(
`t
icket
_id`
,
`state`
,
`timestamp`
),
KEY
`ticket_state`
(
`t
hread
_id`
,
`state`
,
`timestamp`
),
KEY
`ticket_stats`
(
`timestamp`
,
`state`
)
)
DEFAULT
CHARSET
=
utf8
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment