Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
238ef8a1
Commit
238ef8a1
authored
Apr 27, 2017
by
Oswaldo Ferreira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add single column indexes and foreign keys
parent
bbe9cd8d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
2 deletions
+9
-2
db/migrate/20170424131911_create_related_issues_table.rb
db/migrate/20170424131911_create_related_issues_table.rb
+5
-2
db/schema.rb
db/schema.rb
+4
-0
No files found.
db/migrate/20170424131911_create_related_issues_table.rb
View file @
238ef8a1
...
...
@@ -5,12 +5,15 @@ class CreateRelatedIssuesTable < ActiveRecord::Migration
def
change
create_table
:related_issues
do
|
t
|
t
.
integer
:issue_id
,
null:
false
t
.
integer
:related_issue_id
,
null:
false
t
.
integer
:issue_id
,
null:
false
,
index:
true
t
.
integer
:related_issue_id
,
null:
false
,
index:
true
t
.
timestamps
null:
true
end
add_index
:related_issues
,
[
:issue_id
,
:related_issue_id
],
unique:
true
add_foreign_key
:related_issues
,
:issues
,
column: :issue_id
add_foreign_key
:related_issues
,
:issues
,
column: :related_issue_id
end
end
db/schema.rb
View file @
238ef8a1
...
...
@@ -1312,6 +1312,8 @@ ActiveRecord::Schema.define(version: 20170602003304) do
end
add_index
"related_issues"
,
[
"issue_id"
,
"related_issue_id"
],
name:
"index_related_issues_on_issue_id_and_related_issue_id"
,
unique:
true
,
using: :btree
add_index
"related_issues"
,
[
"issue_id"
],
name:
"index_related_issues_on_issue_id"
,
using: :btree
add_index
"related_issues"
,
[
"related_issue_id"
],
name:
"index_related_issues_on_related_issue_id"
,
using: :btree
create_table
"releases"
,
force: :cascade
do
|
t
|
t
.
string
"tag"
...
...
@@ -1745,6 +1747,8 @@ ActiveRecord::Schema.define(version: 20170602003304) do
add_foreign_key
"protected_tag_create_access_levels"
,
"namespaces"
,
column:
"group_id"
add_foreign_key
"protected_tag_create_access_levels"
,
"protected_tags"
add_foreign_key
"protected_tag_create_access_levels"
,
"users"
add_foreign_key
"related_issues"
,
"issues"
add_foreign_key
"related_issues"
,
"issues"
,
column:
"related_issue_id"
add_foreign_key
"remote_mirrors"
,
"projects"
add_foreign_key
"subscriptions"
,
"projects"
,
on_delete: :cascade
add_foreign_key
"system_note_metadata"
,
"notes"
,
name:
"fk_d83a918cb1"
,
on_delete: :cascade
...
...
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