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
cbad5e83
Commit
cbad5e83
authored
7 years ago
by
pupi1985
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix table counts during Q2A installation
parent
cfec3c01
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
4 deletions
+13
-4
install.php
qa-include/db/install.php
+2
-2
qa-db.php
qa-include/qa-db.php
+11
-2
No files found.
qa-include/db/install.php
View file @
cbad5e83
...
...
@@ -555,7 +555,7 @@ function qa_array_to_keys($array)
*/
function
qa_db_missing_tables
(
$definitions
)
{
$keydbtables
=
qa_array_to_keys
(
qa_db_list_tables
());
$keydbtables
=
qa_array_to_keys
(
qa_db_list_tables
(
true
));
$missing
=
array
();
...
...
@@ -776,7 +776,7 @@ function qa_db_upgrade_tables()
// Write-lock all Q2A tables before we start so no one can read or write anything
$keydbtables
=
qa_array_to_keys
(
qa_db_list_tables
());
$keydbtables
=
qa_array_to_keys
(
qa_db_list_tables
(
true
));
foreach
(
$definitions
as
$rawname
=>
$definition
)
if
(
isset
(
$keydbtables
[
qa_db_add_table_prefix
(
$rawname
)]))
...
...
This diff is collapsed.
Click to expand it.
qa-include/qa-db.php
View file @
cbad5e83
...
...
@@ -448,10 +448,19 @@ function qa_db_list_tables_lc()
/**
* Return an array of the names of all tables in the Q2A database.
*
* @param bool $onlyTablesWithPrefix Determine if the result should only include tables with the
* QA_MYSQL_TABLE_PREFIX or if it should include all tables in the database.
*/
function
qa_db_list_tables
()
function
qa_db_list_tables
(
$onlyTablesWithPrefix
=
false
)
{
return
qa_db_read_all_values
(
qa_db_query_raw
(
'SHOW TABLES'
));
$query
=
'SHOW TABLES'
;
if
(
$onlyTablesWithPrefix
)
{
$query
.=
' LIKE "'
.
QA_MYSQL_TABLE_PREFIX
.
'%"'
;
}
return
qa_db_read_all_values
(
qa_db_query_raw
(
$query
));
}
...
...
This diff is collapsed.
Click to expand it.
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