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
7afdb317
Commit
7afdb317
authored
May 17, 2017
by
Oswaldo Ferreira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove related_issues and add issue_links table
parent
fbdc335d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
38 additions
and
38 deletions
+38
-38
db/migrate/20170424131911_create_related_issues_table.rb
db/migrate/20170424131911_create_related_issues_table.rb
+0
-25
db/migrate/20170517162048_create_issue_links_table.rb
db/migrate/20170517162048_create_issue_links_table.rb
+25
-0
db/schema.rb
db/schema.rb
+13
-13
No files found.
db/migrate/20170424131911_create_related_issues_table.rb
deleted
100644 → 0
View file @
fbdc335d
class
CreateRelatedIssuesTable
<
ActiveRecord
::
Migration
include
Gitlab
::
Database
::
MigrationHelpers
DOWNTIME
=
false
disable_ddl_transaction!
def
up
create_table
:related_issues
do
|
t
|
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_concurrent_foreign_key
:related_issues
,
:issues
,
column: :issue_id
add_concurrent_foreign_key
:related_issues
,
:issues
,
column: :related_issue_id
end
def
down
drop_table
:related_issues
end
end
db/migrate/20170517162048_create_issue_links_table.rb
0 → 100644
View file @
7afdb317
class
CreateIssueLinksTable
<
ActiveRecord
::
Migration
include
Gitlab
::
Database
::
MigrationHelpers
DOWNTIME
=
false
disable_ddl_transaction!
def
up
create_table
:issue_links
do
|
t
|
t
.
integer
:source_id
,
null:
false
,
index:
true
t
.
integer
:target_id
,
null:
false
,
index:
true
t
.
timestamps
null:
true
end
add_index
:issue_links
,
[
:source_id
,
:target_id
],
unique:
true
add_concurrent_foreign_key
:issue_links
,
:issues
,
column: :source_id
add_concurrent_foreign_key
:issue_links
,
:issues
,
column: :target_id
end
def
down
drop_table
:issue_links
end
end
db/schema.rb
View file @
7afdb317
...
...
@@ -591,6 +591,17 @@ ActiveRecord::Schema.define(version: 20170602003304) do
add_index
"issue_assignees"
,
[
"issue_id"
,
"user_id"
],
name:
"index_issue_assignees_on_issue_id_and_user_id"
,
unique:
true
,
using: :btree
add_index
"issue_assignees"
,
[
"user_id"
],
name:
"index_issue_assignees_on_user_id"
,
using: :btree
create_table
"issue_links"
,
force: :cascade
do
|
t
|
t
.
integer
"source_id"
,
null:
false
t
.
integer
"target_id"
,
null:
false
t
.
datetime
"created_at"
t
.
datetime
"updated_at"
end
add_index
"issue_links"
,
[
"source_id"
,
"target_id"
],
name:
"index_issue_links_on_source_id_and_target_id"
,
unique:
true
,
using: :btree
add_index
"issue_links"
,
[
"source_id"
],
name:
"index_issue_links_on_source_id"
,
using: :btree
add_index
"issue_links"
,
[
"target_id"
],
name:
"index_issue_links_on_target_id"
,
using: :btree
create_table
"issue_metrics"
,
force: :cascade
do
|
t
|
t
.
integer
"issue_id"
,
null:
false
t
.
datetime
"first_mentioned_in_commit_at"
...
...
@@ -1304,17 +1315,6 @@ ActiveRecord::Schema.define(version: 20170602003304) do
add_index
"redirect_routes"
,
[
"path"
],
name:
"index_redirect_routes_on_path_text_pattern_ops"
,
using: :btree
,
opclasses:
{
"path"
=>
"varchar_pattern_ops"
}
add_index
"redirect_routes"
,
[
"source_type"
,
"source_id"
],
name:
"index_redirect_routes_on_source_type_and_source_id"
,
using: :btree
create_table
"related_issues"
,
force: :cascade
do
|
t
|
t
.
integer
"issue_id"
,
null:
false
t
.
integer
"related_issue_id"
,
null:
false
t
.
datetime
"created_at"
t
.
datetime
"updated_at"
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"
t
.
text
"description"
...
...
@@ -1719,6 +1719,8 @@ ActiveRecord::Schema.define(version: 20170602003304) do
add_foreign_key
"container_repositories"
,
"projects"
add_foreign_key
"issue_assignees"
,
"issues"
,
name:
"fk_b7d881734a"
,
on_delete: :cascade
add_foreign_key
"issue_assignees"
,
"users"
,
name:
"fk_5e0c8d9154"
,
on_delete: :cascade
add_foreign_key
"issue_links"
,
"issues"
,
column:
"source_id"
,
name:
"fk_c900194ff2"
,
on_delete: :cascade
add_foreign_key
"issue_links"
,
"issues"
,
column:
"target_id"
,
name:
"fk_e71bb44f1f"
,
on_delete: :cascade
add_foreign_key
"issue_metrics"
,
"issues"
,
on_delete: :cascade
add_foreign_key
"label_priorities"
,
"labels"
,
on_delete: :cascade
add_foreign_key
"label_priorities"
,
"projects"
,
on_delete: :cascade
...
...
@@ -1747,8 +1749,6 @@ 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"
,
column:
"related_issue_id"
,
name:
"fk_f89e405611"
,
on_delete: :cascade
add_foreign_key
"related_issues"
,
"issues"
,
name:
"fk_7bc934491d"
,
on_delete: :cascade
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