Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
drupal
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
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
project
drupal
Commits
29dc1d64
Commit
29dc1d64
authored
15 years ago
by
Dries Buytaert
Browse files
Options
Downloads
Patches
Plain Diff
- Patch
#734750
by Damien Tournoud: unnecessary belly-dancing about indexes on {comment}.
parent
58e98669
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!7452
Issue #1797438. HTML5 validation is preventing form submit and not fully...
,
!789
Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
modules/comment/comment.install
+10
-24
10 additions, 24 deletions
modules/comment/comment.install
with
10 additions
and
24 deletions
modules/comment/comment.install
+
10
−
24
View file @
29dc1d64
...
...
@@ -139,16 +139,6 @@ function comment_update_7002() {
db_rename_table
(
'comments'
,
'comment'
);
}
/**
* Improve indexes on the comment table.
*/
function
comment_update_7003
()
{
db_drop_index
(
'comment'
,
'status'
);
db_drop_index
(
'comment'
,
'pid'
);
db_add_index
(
'comment'
,
'comment_pid_status'
,
array
(
'pid'
,
'status'
));
db_add_index
(
'comment'
,
'comment_num_new'
,
array
(
'nid'
,
'timestamp'
,
'status'
));
}
/**
* Rename comment display setting variables.
*/
...
...
@@ -183,11 +173,12 @@ function comment_update_7006() {
}
/**
* Split {comment}.timestamp into
{comment}.
created and {comment}.
changed.
* Split {comment}.timestamp into
'
created
'
and
'changed', improve indexing on
{comment}.
*/
function
comment_update_7007
()
{
// Drop the index associated to timestamp.
db_drop_index
(
'comment'
,
'comment_num_new'
);
// Drop the old indexes.
db_drop_index
(
'comment'
,
'status'
);
db_drop_index
(
'comment'
,
'pid'
);
// Create a created column.
db_add_field
(
'comment'
,
'created'
,
array
(
...
...
@@ -203,12 +194,15 @@ function comment_update_7007() {
'default'
=>
0
,
));
// Recreate the index.
db_add_index
(
'comment'
,
'comment_num_new'
,
array
(
'nid'
,
'changed'
,
'status'
));
// Migrate the data.
// @todo db_update() should support this.
db_query
(
'UPDATE {comment} SET created = changed'
);
// Recreate the indexes.
// The 'comment_num_new' index is optimized for comment_num_new()
// and comment_new_page_count().
db_add_index
(
'comment'
,
'comment_num_new'
,
array
(
'nid'
,
'status'
,
'created'
,
'cid'
,
'thread'
));
db_add_index
(
'comment'
,
'comment_pid_status'
,
array
(
'pid'
,
'status'
));
}
/**
...
...
@@ -351,14 +345,6 @@ function comment_update_7013(&$sandbox) {
}
}
/**
* Optimize index for comment_num_new() and comment_new_page_count().
*/
function
comment_update_7014
()
{
db_drop_index
(
'comment'
,
'comment_num_new'
);
db_add_index
(
'comment'
,
'comment_num_new'
,
array
(
'nid'
,
'status'
,
'created'
,
'cid'
,
'thread'
));
}
/**
* @} End of "defgroup updates-6.x-to-7.x"
* The next series of updates should start at 8000.
...
...
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