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
b84723ac
Commit
b84723ac
authored
Mar 10, 2017
by
Valery Sizov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Issue Sorting] Improve migration
parent
56707777
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
5 deletions
+3
-5
db/post_migrate/20170309171644_reset_relative_position_for_issue.rb
...grate/20170309171644_reset_relative_position_for_issue.rb
+3
-4
spec/models/concerns/relative_positioning_spec.rb
spec/models/concerns/relative_positioning_spec.rb
+0
-1
No files found.
db/post_migrate/20170309171644_reset_relative_position_for_issue.rb
View file @
b84723ac
...
...
@@ -7,10 +7,9 @@ class ResetRelativePositionForIssue < ActiveRecord::Migration
DOWNTIME
=
false
def
up
execute
<<-
EOS
UPDATE issues SET relative_position = NULL
WHERE issues.relative_position IS NOT NULL;
EOS
update_column_in_batches
(
:issues
,
:relative_position
,
nil
)
do
|
table
,
query
|
query
.
where
(
table
[
:relative_position
].
not_eq
(
nil
))
end
end
def
down
...
...
spec/models/concerns/relative_positioning_spec.rb
View file @
b84723ac
...
...
@@ -130,7 +130,6 @@ describe Issue, 'RelativePositioning' do
expect
(
new_issue
.
relative_position
).
to
eq
(
6000
+
RelativePositioning
::
DISTANCE
)
end
it
'positions issue in the middle of other two if distance is not big enough'
do
issue
.
update
relative_position:
100
issue1
.
update
relative_position:
400
...
...
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