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
Merge requests
!4162
Issue
#3365945
: Resolve primary key issue.
Code
Review changes
Check out branch
Download
Patches
Plain diff
Closed
Issue
#3365945
: Resolve primary key issue.
issue/drupal-3365945:3365945-errors-the-following
into
11.x
Overview
4
Commits
3
Pipelines
0
Changes
1
All threads resolved!
Hide all comments
Closed
Sakthi Shanmuga Sundaram M
requested to merge
issue/drupal-3365945:3365945-errors-the-following
into
11.x
1 year ago
Overview
4
Commits
3
Pipelines
0
Changes
1
All threads resolved!
Hide all comments
Expand
Closes
#3365945
0
0
Merge request reports
Compare
11.x
version 4
49588cd4
1 year ago
version 3
7a4fd485
1 year ago
version 2
fe66fb43
1 year ago
version 1
4703365e
1 year ago
11.x (base)
and
latest version
latest version
49588cd4
3 commits,
1 year ago
version 4
49588cd4
2373 commits,
1 year ago
version 3
7a4fd485
3 commits,
1 year ago
version 2
fe66fb43
2 commits,
1 year ago
version 1
4703365e
1 commit,
1 year ago
1 file
+
13
−
0
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
core/modules/forum/forum.install
+
13
−
0
Options
@@ -161,6 +161,7 @@ function forum_schema() {
'created'
=>
[
'created'
],
'last_comment_timestamp'
=>
[
'last_comment_timestamp'
],
],
'primary key'
=>
[
'nid'
,
'tid'
],
'foreign keys'
=>
[
'tracked_node'
=>
[
'table'
=>
'node'
,
@@ -204,3 +205,15 @@ function forum_update_10100(&$sandbox = NULL) {
$connection
->
schema
()
->
changeField
(
'forum_index'
,
'last_comment_timestamp'
,
'last_comment_timestamp'
,
$new
);
}
}
/**
* Add a primary key to forum_index.
*/
function
forum_update_10101
(
&
$sandbox
=
NULL
)
{
$connection
=
\Drupal
::
database
();
if
(
$connection
->
schema
()
->
tableExists
(
'forum_index'
))
{
$connection
->
schema
()
->
addPrimaryKey
(
'forum_index'
,
[
'nid'
,
'tid'
]);
return
\t
(
'Added primary key to the forum_index table.'
);
}
return
\t
(
'Index already exists'
);
}
Loading