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
Jérome Perrin
gitlab-ce
Commits
c3659ef2
Commit
c3659ef2
authored
Feb 25, 2013
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix merge request migration for postgres
parent
ed60b6fc
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
db/migrate/20130218141327_convert_closed_to_state_in_merge_request.rb
...0130218141327_convert_closed_to_state_in_merge_request.rb
+5
-5
No files found.
db/migrate/20130218141327_convert_closed_to_state_in_merge_request.rb
View file @
c3659ef2
class
ConvertClosedToStateInMergeRequest
<
ActiveRecord
::
Migration
class
ConvertClosedToStateInMergeRequest
<
ActiveRecord
::
Migration
def
up
def
up
MergeRequest
.
transaction
do
MergeRequest
.
transaction
do
MergeRequest
.
where
(
"closed = 1 AND merged = 1"
).
update_all
(
"state = 'merged'"
)
MergeRequest
.
where
(
closed:
true
,
merged:
true
).
update_all
(
"state = 'merged'"
)
MergeRequest
.
where
(
"closed = 1 AND merged = 0"
).
update_all
(
"state = 'closed'"
)
MergeRequest
.
where
(
closed:
true
,
merged:
true
).
update_all
(
"state = 'closed'"
)
MergeRequest
.
where
(
"closed = 0"
).
update_all
(
"state = 'opened'"
)
MergeRequest
.
where
(
closed:
false
).
update_all
(
"state = 'opened'"
)
end
end
end
end
def
down
def
down
MergeRequest
.
transaction
do
MergeRequest
.
transaction
do
MergeRequest
.
where
(
state: :closed
).
update_all
(
"closed = 1"
)
MergeRequest
.
where
(
state: :closed
).
update_all
(
closed:
true
)
MergeRequest
.
where
(
state: :merged
).
update_all
(
"closed = 1, merged = 1"
)
MergeRequest
.
where
(
state: :merged
).
update_all
(
closed:
true
,
merged:
true
)
end
end
end
end
end
end
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