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
0
Merge Requests
0
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
iv
gitlab-ce
Commits
dda7f963
Commit
dda7f963
authored
Mar 17, 2016
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add field that references issue this issue has been moved to
parent
5e405bfe
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
1 deletion
+11
-1
app/models/issue.rb
app/models/issue.rb
+3
-0
db/migrate/20160317092222_add_moved_to_to_issue.rb
db/migrate/20160317092222_add_moved_to_to_issue.rb
+5
-0
db/schema.rb
db/schema.rb
+3
-1
No files found.
app/models/issue.rb
View file @
dda7f963
...
...
@@ -16,6 +16,7 @@
# state :string(255)
# iid :integer
# updated_by_id :integer
# moved_to_id :integer
#
require
'carrierwave/orm/activerecord'
...
...
@@ -31,6 +32,8 @@ class Issue < ActiveRecord::Base
ActsAsTaggableOn
.
strict_case_match
=
true
belongs_to
:project
belongs_to
:moved_to
,
class_name:
'Issue'
validates
:project
,
presence:
true
scope
:of_group
,
...
...
db/migrate/20160317092222_add_moved_to_to_issue.rb
0 → 100644
View file @
dda7f963
class
AddMovedToToIssue
<
ActiveRecord
::
Migration
def
change
add_reference
:issues
,
:moved_to
,
references: :issues
,
index:
true
end
end
db/schema.rb
View file @
dda7f963
...
...
@@ -11,7 +11,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord
::
Schema
.
define
(
version:
2016031
6123110
)
do
ActiveRecord
::
Schema
.
define
(
version:
2016031
7092222
)
do
# These are extensions that must be enabled in order to support this database
enable_extension
"plpgsql"
...
...
@@ -416,6 +416,7 @@ ActiveRecord::Schema.define(version: 20160316123110) do
t
.
string
"state"
t
.
integer
"iid"
t
.
integer
"updated_by_id"
t
.
integer
"moved_to_id"
end
add_index
"issues"
,
[
"assignee_id"
],
name:
"index_issues_on_assignee_id"
,
using: :btree
...
...
@@ -424,6 +425,7 @@ ActiveRecord::Schema.define(version: 20160316123110) do
add_index
"issues"
,
[
"created_at"
],
name:
"index_issues_on_created_at"
,
using: :btree
add_index
"issues"
,
[
"description"
],
name:
"index_issues_on_description_trigram"
,
using: :gin
,
opclasses:
{
"description"
=>
"gin_trgm_ops"
}
add_index
"issues"
,
[
"milestone_id"
],
name:
"index_issues_on_milestone_id"
,
using: :btree
add_index
"issues"
,
[
"moved_to_id"
],
name:
"index_issues_on_moved_to_id"
,
using: :btree
add_index
"issues"
,
[
"project_id"
,
"iid"
],
name:
"index_issues_on_project_id_and_iid"
,
unique:
true
,
using: :btree
add_index
"issues"
,
[
"project_id"
],
name:
"index_issues_on_project_id"
,
using: :btree
add_index
"issues"
,
[
"state"
],
name:
"index_issues_on_state"
,
using: :btree
...
...
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