Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
drupal-3253715
Manage
Activity
Members
Labels
Plan
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
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
Issue forks
drupal-3253715
Commits
f6929dcc
Commit
f6929dcc
authored
18 years ago
by
Steven Wittens
Browse files
Options
Downloads
Patches
Plain Diff
#127941
: Add index to users.created column.
parent
cbf8b1f6
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
modules/system/system.install
+54
-0
54 additions, 0 deletions
modules/system/system.install
with
54 additions
and
0 deletions
modules/system/system.install
+
54
−
0
View file @
f6929dcc
...
...
@@ -571,6 +571,7 @@ function system_install() {
data longtext,
PRIMARY KEY (uid),
UNIQUE KEY name (name),
KEY created (created),
KEY access (access)
) /*!40100 DEFAULT CHARACTER SET UTF8 */ "
);
...
...
@@ -1058,6 +1059,7 @@ function system_install() {
UNIQUE (name)
)"
);
db_query
(
"CREATE INDEX
{
users
}
_access_idx ON
{
users
}
(access)"
);
db_query
(
"CREATE INDEX
{
users
}
_created_idx ON
{
users
}
(created)"
);
db_query
(
"CREATE TABLE
{
users_roles
}
(
uid int_unsigned NOT NULL default '0',
...
...
@@ -3544,6 +3546,35 @@ function system_update_1021() {
*/
/**
* @defgroup updates-5.x-extra Extra system updates for 5.x
* @{
*/
/**
* Add index on users created column.
*/
function
system_update_1022
()
{
$ret
=
array
();
switch
(
$GLOBALS
[
'db_type'
])
{
case
'mysql'
:
case
'mysqli'
:
$ret
[]
=
update_sql
(
'ALTER TABLE {users} ADD KEY created (created)'
);
break
;
case
'pgsql'
:
$ret
[]
=
update_sql
(
"CREATE INDEX
{
users
}
_created_idx ON
{
users
}
(created)"
);
break
;
}
// Also appears as system_update_2004(). Ensure we don't update twice.
variable_set
(
'system_update_1022'
,
TRUE
);
return
$ret
;
}
/**
* @} End of "defgroup updates-5.x-extra"
*/
/**
* @defgroup updates-5.0-to-x.x System updates from 5.0 to x.x
* @{
...
...
@@ -3632,6 +3663,29 @@ function system_update_2003() {
return
$ret
;
}
/**
* Add index on users created column.
*/
function
system_update_2004
()
{
// Already run as system_update_1022?
if
(
variable_get
(
'system_update_1022'
,
FALSE
))
{
variable_del
(
'system_update_1022'
);
return
array
();
}
$ret
=
array
();
switch
(
$GLOBALS
[
'db_type'
])
{
case
'mysql'
:
case
'mysqli'
:
$ret
[]
=
update_sql
(
'ALTER TABLE {users} ADD KEY created (created)'
);
break
;
case
'pgsql'
:
$ret
[]
=
update_sql
(
"CREATE INDEX
{
users
}
_created_idx ON
{
users
}
(created)"
);
break
;
}
return
$ret
;
}
/**
* @} End of "defgroup updates-5.0-to-x.x"
* The next series of updates should start at 3000.
...
...
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