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
cfaa5134
Commit
cfaa5134
authored
12 years ago
by
Peter Rotich
Browse files
Options
Downloads
Patches
Plain Diff
Fix SQL schema errors
parent
570a8343
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/patches/c00511c7-7be60a84.patch.sql
+30
-14
30 additions, 14 deletions
include/upgrader/patches/c00511c7-7be60a84.patch.sql
include/upgrader/patches/f8856d56-abe9c0cb.patch.sql
+7
-9
7 additions, 9 deletions
include/upgrader/patches/f8856d56-abe9c0cb.patch.sql
with
37 additions
and
23 deletions
include/upgrader/patches/c00511c7-7be60a84.patch.sql
+
30
−
14
View file @
cfaa5134
/**
* @version v1.7-*
* @version v1.7
*
* @schema c00511c7c1db65c0cfad04b4842afc57
*/
...
...
@@ -70,8 +71,8 @@ ALTER TABLE `%TABLE_PREFIX%config`
ALTER
TABLE
`%TABLE_PREFIX%staff`
ADD
`passwdreset`
DATETIME
NULL
DEFAULT
NULL
AFTER
`lastlogin`
;
DROP
TABLE
IF
EXISTS
`%T
ICKET
_PREFIX%sla`
;
CREATE
TABLE
IF
NOT
EXISTS
`%T
ICKET
_PREFIX%sla`
(
DROP
TABLE
IF
EXISTS
`%T
ABLE
_PREFIX%sla`
;
CREATE
TABLE
IF
NOT
EXISTS
`%T
ABLE
_PREFIX%sla`
(
`id`
int
(
11
)
unsigned
NOT
NULL
auto_increment
,
`isactive`
tinyint
(
1
)
unsigned
NOT
NULL
default
'1'
,
`enable_priority_escalation`
tinyint
(
1
)
unsigned
NOT
NULL
default
'1'
,
...
...
@@ -107,8 +108,16 @@ CREATE TABLE IF NOT EXISTS `%TABLE_PREFIX%team` (
)
ENGINE
=
MyISAM
;
-- Create a default TEAM
INSERT
INTO
`%TABLE_PREFIX%team`
(
`lead_id`
,
`isenabled`
,
`noalerts`
,
`name`
,
`notes`
)
VALUES
(
0
,
1
,
0
,
'Level I Support'
,
''
);
INSERT
INTO
`%TABLE_PREFIX%team`
(
`lead_id`
,
`isenabled`
,
`noalerts`
,
`name`
,
`notes`
,
`created`
,
`updated`
)
VALUES
(
0
,
1
,
0
,
'Level I Support'
,
''
,
NOW
(),
NOW
());
DROP
TABLE
IF
EXISTS
`%TABLE_PREFIX%team_member`
;
CREATE
TABLE
IF
NOT
EXISTS
`%TABLE_PREFIX%team_member`
(
`team_id`
int
(
10
)
unsigned
NOT
NULL
default
'0'
,
`staff_id`
int
(
10
)
unsigned
NOT
NULL
,
`updated`
datetime
NOT
NULL
,
PRIMARY
KEY
(
`team_id`
,
`staff_id`
)
)
ENGINE
=
MyISAM
;
ALTER
TABLE
`%TABLE_PREFIX%department`
ADD
sla_id
INT
UNSIGNED
NOT
NULL
DEFAULT
'0'
AFTER
tpl_id
;
...
...
@@ -125,10 +134,10 @@ UPDATE `%TABLE_PREFIX%staff` SET timezone_id =
(
SELECT
id
FROM
`%TABLE_PREFIX%timezone`
WHERE
offset
=
`%TABLE_PREFIX%staff`
.
timezone_offset
);
ALTER
TABLE
`%TABLE_PREFIX%groups`
ADD
notes
TEXT
NULL
AFTER
can_manage_kb
,
CHANGE
`can_manage_kb`
`can_manage_premade`
TINYINT
(
1
)
UNSIGNED
NOT
NULL
DEFAULT
'0'
,
ADD
`can_manage_faq`
TINYINT
(
1
)
UNSIGNED
NOT
NULL
DEFAULT
'0'
AFTER
`can_manage_premade`
,
ADD
`can_assign_tickets`
TINYINT
(
1
)
UNSIGNED
NOT
NULL
default
'1'
AFTER
`can_close_tickets`
;
ADD
`can_assign_tickets`
TINYINT
(
1
)
UNSIGNED
NOT
NULL
default
'1'
AFTER
`can_close_tickets`
,
ADD
notes
TEXT
NULL
AFTER
can_manage_faq
;
-- Add new columns to the templates table
ALTER
TABLE
`%TABLE_PREFIX%email_template`
...
...
@@ -200,7 +209,7 @@ CREATE TABLE `%TABLE_PREFIX%email_filter_rule` (
`what`
enum
(
'name'
,
'email'
,
'subject'
,
'body'
,
'header'
)
NOT
NULL
,
`how`
enum
(
'equal'
,
'not_equal'
,
'contains'
,
'dn_contain'
)
NOT
NULL
,
`val`
varchar
(
255
)
NOT
NULL
,
`isactive`
tiny
tex
t
(
1
)
UNSIGNED
NOT
NULL
DEFAULT
'1'
,
`isactive`
tiny
in
t
(
1
)
UNSIGNED
NOT
NULL
DEFAULT
'1'
,
`notes`
tinytext
NOT
NULL
,
`created`
datetime
NOT
NULL
,
`updated`
datetime
NOT
NULL
,
...
...
@@ -210,8 +219,8 @@ CREATE TABLE `%TABLE_PREFIX%email_filter_rule` (
)
ENGINE
=
MyISAM
DEFAULT
CHARSET
=
utf8
;
-- SYSTEM BAN LIST was the first filter created, with ID of '1'
INSERT
INTO
`%TABLE_PREFIX%email_filter_rule`
(
`filter_id`
,
`what`
,
`how`
,
`val`
)
VALUES
SELECT
1
,
'email'
,
'equals'
,
email
FROM
`%TABLE_PREFIX%email_banlist`
;
INSERT
INTO
`%TABLE_PREFIX%email_filter_rule`
(
`filter_id`
,
`what`
,
`how`
,
`val`
)
SELECT
1
,
'email'
,
'equals'
,
email
FROM
`%TABLE_PREFIX%email_banlist`
;
-- Create table session
DROP
TABLE
IF
EXISTS
`%TABLE_PREFIX%session`
;
...
...
@@ -264,12 +273,12 @@ CREATE TABLE IF NOT EXISTS `%TABLE_PREFIX%canned_attachment` (
-- Rename kb_premade to canned_response
ALTER
TABLE
`%TABLE_PREFIX%kb_premade`
ADD
`notes`
TEXT
NOT
NULL
AFTER
`answer`
,
CHANGE
`premade_id`
`canned_id`
int
(
10
)
unsigned
NOT
NULL
auto_increment
,
CHANGE
`title`
`title`
VARCHAR
(
255
)
NOT
NULL
DEFAULT
''
,
CHANGE
`answer`
`response`
TEXT
NOT
NULL
.
DROP
INDEX
`title`
,
ADD
FULLTEXT
`resp`
(
`title`
,
`answer`
);
CHANGE
`answer`
`response`
TEXT
NOT
NULL
,
ADD
`notes`
TEXT
NOT
NULL
AFTER
`response`
,
DROP
INDEX
`title`
,
ADD
FULLTEXT
`resp`
(
`title`
,
`response`
);
ALTER
TABLE
`%TABLE_PREFIX%kb_premade`
RENAME
TO
`%TABLE_PREFIX%canned_response`
;
...
...
@@ -293,5 +302,12 @@ CREATE TABLE IF NOT EXISTS `%TABLE_PREFIX%faq_topic` (
PRIMARY
KEY
(
`faq_id`
,
`topic_id`
)
)
ENGINE
=
MyISAM
DEFAULT
CHARSET
=
utf8
;
-- Drop columns we nolonger need - (must be at the very bottom or after session table is created)
ALTER
TABLE
`%TABLE_PREFIX%config`
DROP
COLUMN
`ostversion`
,
DROP
COLUMN
`timezone_offset`
,
DROP
COLUMN
`api_passphrase`
;
UPDATE
`%TABLE_PREFIX%config`
SET
`schema_signature`
=
'7be60a8432e44989e782d5914ef784d2'
;
This diff is collapsed.
Click to expand it.
include/upgrader/patches/f8856d56-abe9c0cb.patch.sql
+
7
−
9
View file @
cfaa5134
...
...
@@ -23,7 +23,6 @@ CREATE TABLE `%TABLE_PREFIX%ticket_thread` (
`ip_address`
varchar
(
64
)
NOT
NULL
default
''
,
`created`
datetime
NOT
NULL
,
`updated`
datetime
NOT
NULL
,
-- Temporary columns for conversion
`old_pk`
int
(
11
)
unsigned
NOT
NULL
,
`old_pid`
int
(
11
)
unsigned
,
PRIMARY
KEY
(
`id`
),
...
...
@@ -70,14 +69,13 @@ DROP TABLE `%TABLE_PREFIX%T_resp_links`;
-- Transfer notes
INSERT
INTO
`%TABLE_PREFIX%ticket_thread`
(
`ticket_id`
,
`staff_id`
,
`thread_type`
,
`body`
,
`title`
,
`source`
,
`poster`
,
`created`
,
`updated`
,
`old_pk`
)
SELECT
`ticket_id`
,
`staff_id`
,
'N'
,
`note`
,
`title`
,
`source`
,
(
SELECT
CONCAT_WS
(
' '
,
T2
.
`firstname`
,
T2
.
`lastname`
)
FROM
`%TABLE_PREFIX%staff`
T2
WHERE
T2
.
`staff_id`
=
`staff_id`
),
`created`
,
NOW
(),
`note_id`
FROM
`%TABLE_PREFIX%ticket_note`
;
(
`ticket_id`
,
`staff_id`
,
`thread_type`
,
`body`
,
`title`
,
`source`
,
`poster`
,
`created`
,
`updated`
,
`old_pk`
)
SELECT
`ticket_id`
,
N
.
staff_id
,
'N'
,
`note`
,
`title`
,
`source`
,
CONCAT_WS
(
' '
,
S
.
`firstname`
,
S
.
`lastname`
),
N
.
created
,
NOW
(),
`note_id`
FROM
`%TABLE_PREFIX%ticket_note`
N
LEFT
JOIN
`%TABLE_PREFIX%staff`
S
ON
(
S
.
staff_id
=
N
.
staff_id
);
-- Transfer email information from messages
INSERT
INTO
`%TABLE_PREFIX%ticket_email_info`
...
...
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