Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Nextcloud
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Monitor
Service Desk
Analyze
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
TeDomum
Nextcloud
Commits
16cc68a2
Unverified
Commit
16cc68a2
authored
6 years ago
by
Roeland Jago Douma
Browse files
Options
Downloads
Patches
Plain Diff
Add twofactor_providers_uid index
Fixes #12943 Signed-off-by:
Roeland Jago Douma
<
roeland@famdouma.nl
>
parent
c2d75ddc
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
core/Application.php
+8
-0
8 additions, 0 deletions
core/Application.php
core/Command/Db/AddMissingIndices.php
+15
-2
15 additions, 2 deletions
core/Command/Db/AddMissingIndices.php
core/Migrations/Version14000Date20180522074438.php
+1
-0
1 addition, 0 deletions
core/Migrations/Version14000Date20180522074438.php
with
24 additions
and
2 deletions
core/Application.php
+
8
−
0
View file @
16cc68a2
...
@@ -85,6 +85,14 @@ class Application extends App {
...
@@ -85,6 +85,14 @@ class Application extends App {
$subject
->
addHintForMissingSubject
(
$table
->
getName
(),
'fs_mtime'
);
$subject
->
addHintForMissingSubject
(
$table
->
getName
(),
'fs_mtime'
);
}
}
}
}
if
(
$schema
->
hasTable
(
'twofactor_providers'
))
{
$table
=
$schema
->
getTable
(
'twofactor_providers'
);
if
(
!
$table
->
hasIndex
(
'twofactor_providers_uid'
))
{
$subject
->
addHintForMissingSubject
(
$table
->
getName
(),
'twofactor_providers_uid'
);
}
}
}
}
);
);
}
}
...
...
This diff is collapsed.
Click to expand it.
core/Command/Db/AddMissingIndices.php
+
15
−
2
View file @
16cc68a2
...
@@ -61,7 +61,7 @@ class AddMissingIndices extends Command {
...
@@ -61,7 +61,7 @@ class AddMissingIndices extends Command {
}
}
protected
function
execute
(
InputInterface
$input
,
OutputInterface
$output
)
{
protected
function
execute
(
InputInterface
$input
,
OutputInterface
$output
)
{
$this
->
add
ShareTableIndici
es
(
$output
);
$this
->
add
CoreIndex
es
(
$output
);
// Dispatch event so apps can also update indexes if needed
// Dispatch event so apps can also update indexes if needed
$event
=
new
GenericEvent
(
$output
);
$event
=
new
GenericEvent
(
$output
);
...
@@ -74,7 +74,7 @@ class AddMissingIndices extends Command {
...
@@ -74,7 +74,7 @@ class AddMissingIndices extends Command {
* @param OutputInterface $output
* @param OutputInterface $output
* @throws \Doctrine\DBAL\Schema\SchemaException
* @throws \Doctrine\DBAL\Schema\SchemaException
*/
*/
private
function
add
ShareTableIndici
es
(
OutputInterface
$output
)
{
private
function
add
CoreIndex
es
(
OutputInterface
$output
)
{
$output
->
writeln
(
'<info>Check indices of the share table.</info>'
);
$output
->
writeln
(
'<info>Check indices of the share table.</info>'
);
...
@@ -116,6 +116,7 @@ class AddMissingIndices extends Command {
...
@@ -116,6 +116,7 @@ class AddMissingIndices extends Command {
}
}
}
}
$output
->
writeln
(
'<info>Check indices of the filecache table.</info>'
);
if
(
$schema
->
hasTable
(
'filecache'
))
{
if
(
$schema
->
hasTable
(
'filecache'
))
{
$table
=
$schema
->
getTable
(
'filecache'
);
$table
=
$schema
->
getTable
(
'filecache'
);
if
(
!
$table
->
hasIndex
(
'fs_mtime'
))
{
if
(
!
$table
->
hasIndex
(
'fs_mtime'
))
{
...
@@ -127,6 +128,18 @@ class AddMissingIndices extends Command {
...
@@ -127,6 +128,18 @@ class AddMissingIndices extends Command {
}
}
}
}
$output
->
writeln
(
'<info>Check indices of the twofactor_providers table.</info>'
);
if
(
$schema
->
hasTable
(
'twofactor_providers'
))
{
$table
=
$schema
->
getTable
(
'twofactor_providers'
);
if
(
!
$table
->
hasIndex
(
'twofactor_providers_uid'
))
{
$output
->
writeln
(
'<info>Adding additional twofactor_providers_uid index to the twofactor_providers table, this can take some time...</info>'
);
$table
->
addIndex
([
'uid'
],
'twofactor_providers_uid'
);
$this
->
connection
->
migrateToSchema
(
$schema
->
getWrappedSchema
());
$updated
=
true
;
$output
->
writeln
(
'<info>Twofactor_providers table updated successfully.</info>'
);
}
}
if
(
!
$updated
)
{
if
(
!
$updated
)
{
$output
->
writeln
(
'<info>Done.</info>'
);
$output
->
writeln
(
'<info>Done.</info>'
);
}
}
...
...
This diff is collapsed.
Click to expand it.
core/Migrations/Version14000Date20180522074438.php
+
1
−
0
View file @
16cc68a2
...
@@ -55,6 +55,7 @@ class Version14000Date20180522074438 extends SimpleMigrationStep {
...
@@ -55,6 +55,7 @@ class Version14000Date20180522074438 extends SimpleMigrationStep {
'length'
=>
1
,
'length'
=>
1
,
]);
]);
$table
->
setPrimaryKey
([
'provider_id'
,
'uid'
]);
$table
->
setPrimaryKey
([
'provider_id'
,
'uid'
]);
$table
->
addIndex
([
'uid'
],
'twofactor_providers_uid'
);
}
}
return
$schema
;
return
$schema
;
...
...
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