Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Q
question2answer
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
outils
question2answer
Commits
130339cb
Commit
130339cb
authored
May 16, 2014
by
Scott
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Database upgrade for hiding messages
parent
5075c435
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
1 deletions
+23
-1
qa-db-install.php
qa-include/qa-db-install.php
+23
-1
No files found.
qa-include/qa-db-install.php
View file @
130339cb
...
...
@@ -29,7 +29,7 @@
exit
;
}
define
(
'QA_DB_VERSION_CURRENT'
,
5
6
);
define
(
'QA_DB_VERSION_CURRENT'
,
5
7
);
function
qa_db_user_column_type_verify
()
...
...
@@ -169,12 +169,15 @@
'type'
=>
"ENUM('PUBLIC', 'PRIVATE') NOT NULL DEFAULT 'PRIVATE'"
,
'fromuserid'
=>
$useridcoltype
.
' NOT NULL'
,
'touserid'
=>
$useridcoltype
.
' NOT NULL'
,
'fromhidden'
=>
'TINYINT(1) UNSIGNED NOT NULL DEFAULT 0'
,
'tohidden'
=>
'TINYINT(1) UNSIGNED NOT NULL DEFAULT 0'
,
'content'
=>
'VARCHAR('
.
QA_DB_MAX_CONTENT_LENGTH
.
') NOT NULL'
,
'format'
=>
'VARCHAR('
.
QA_DB_MAX_FORMAT_LENGTH
.
') CHARACTER SET ascii NOT NULL'
,
'created'
=>
'DATETIME NOT NULL'
,
'PRIMARY KEY (messageid)'
,
'KEY type (type, fromuserid, touserid, created)'
,
'KEY touserid (touserid, type, created)'
,
'KEY fromhidden (fromhidden, tohidden)'
,
),
'userfavorites'
=>
array
(
...
...
@@ -1406,6 +1409,25 @@
// Up to here: Version 1.6 (release)
case
57
:
if
(
!
QA_FINAL_EXTERNAL_USERS
)
{
// might be using messages table shared with another installation, so check if we need to upgrade
$keycolumns
=
qa_array_to_lower_keys
(
qa_db_read_all_values
(
qa_db_query_sub
(
'SHOW COLUMNS FROM ^messages'
)));
if
(
isset
(
$keycolumns
[
'fromhidden'
]))
qa_db_upgrade_progress
(
'Skipping upgrading messages table since it was already upgraded by another Q2A site sharing it.'
);
else
{
qa_db_upgrade_query
(
'ALTER TABLE ^messages ADD COLUMN fromhidden '
.
$definitions
[
'messages'
][
'fromhidden'
]
.
' AFTER touserid'
);
qa_db_upgrade_query
(
'ALTER TABLE ^messages ADD COLUMN tohidden '
.
$definitions
[
'messages'
][
'tohidden'
]
.
' AFTER fromhidden'
);
qa_db_upgrade_query
(
'ALTER TABLE ^messages ADD KEY fromhidden (fromhidden, tohidden)'
);
qa_db_upgrade_query
(
$locktablesquery
);
}
}
break
;
// Up to here: Verison 1.7 alpha 1
}
qa_db_set_db_version
(
$newversion
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment