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
95b15ae8
Commit
95b15ae8
authored
Jul 08, 2019
by
charlieablett
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Modify db migration to use up/down rather than change
- Add changelog file
parent
e13a1aa9
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
5 deletions
+17
-5
db/migrate/20190703001116_default_weight_to_nil.rb
db/migrate/20190703001116_default_weight_to_nil.rb
+12
-5
ee/changelogs/unreleased/4221-board-scope-shouldn-t-persist-1-when-one-selects-any-weight-or-any-milestone.yml
...ersist-1-when-one-selects-any-weight-or-any-milestone.yml
+5
-0
No files found.
db/migrate/20190703001116_default_weight_
milestone_
to_nil.rb
→
db/migrate/20190703001116_default_weight_to_nil.rb
View file @
95b15ae8
...
...
@@ -3,7 +3,7 @@
# See http://doc.gitlab.com/ce/development/migration_style_guide.html
# for more information on how to write migrations for GitLab.
class
DefaultWeight
Milestone
ToNil
<
ActiveRecord
::
Migration
[
5.1
]
class
DefaultWeightToNil
<
ActiveRecord
::
Migration
[
5.1
]
include
Gitlab
::
Database
::
MigrationHelpers
# Set this constant to true if this migration requires downtime.
...
...
@@ -27,16 +27,23 @@ class DefaultWeightMilestoneToNil < ActiveRecord::Migration[5.1]
# comments:
# disable_ddl_transaction!
def
change
def
up
update_board_weights_from_none_to_any
update_board_milestone_from_none_to_any
end
def
down
update_board_weights_from_any_to_none
end
# up method
def
update_board_weights_from_none_to_any
execute
(
"UPDATE boards SET weight = null WHERE weight = -1"
)
end
def
update_board_milestone_from_none_to_any
execute
(
"UPDATE boards SET milestone_id = null WHERE milestone_id = -1"
)
# down method
def
update_board_weights_from_any_to_none
execute
(
"UPDATE boards SET weight = -1 WHERE weight = null"
)
end
end
ee/changelogs/unreleased/4221-board-scope-shouldn-t-persist-1-when-one-selects-any-weight-or-any-milestone.yml
0 → 100644
View file @
95b15ae8
---
title
:
Properly persist -1 and
null
for board weight
merge_request
:
14180
author
:
type
:
changed
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