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
Tatuya Kamada
gitlab-ce
Commits
4a55c698
Commit
4a55c698
authored
Feb 27, 2013
by
Andrew8xx8
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Data converting migrations was wrong. Fixed
parent
135418dc
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
9 deletions
+9
-9
db/migrate/20130218141258_convert_closed_to_state_in_issue.rb
...igrate/20130218141258_convert_closed_to_state_in_issue.rb
+3
-3
db/migrate/20130218141327_convert_closed_to_state_in_merge_request.rb
...0130218141327_convert_closed_to_state_in_merge_request.rb
+3
-3
db/migrate/20130218141344_convert_closed_to_state_in_milestone.rb
...te/20130218141344_convert_closed_to_state_in_milestone.rb
+3
-3
No files found.
db/migrate/20130218141258_convert_closed_to_state_in_issue.rb
View file @
4a55c698
class
ConvertClosedToStateInIssue
<
ActiveRecord
::
Migration
def
up
Issue
.
transaction
do
Issue
.
where
(
closed:
true
).
update_all
(
"state = 'closed'"
)
Issue
.
where
(
closed:
false
).
update_all
(
"state = 'opened'"
)
Issue
.
where
(
closed:
true
).
update_all
(
state: :closed
)
Issue
.
where
(
closed:
false
).
update_all
(
state: :opened
)
end
end
def
down
Issue
.
transaction
do
Issue
.
where
(
state: :closed
).
update_all
(
"closed = 1"
)
Issue
.
where
(
state: :closed
).
update_all
(
closed:
true
)
end
end
end
db/migrate/20130218141327_convert_closed_to_state_in_merge_request.rb
View file @
4a55c698
class
ConvertClosedToStateInMergeRequest
<
ActiveRecord
::
Migration
def
up
MergeRequest
.
transaction
do
MergeRequest
.
where
(
closed:
true
,
merged:
true
).
update_all
(
"state = 'merged'"
)
MergeRequest
.
where
(
closed:
true
,
merged:
true
).
update_all
(
"state = 'closed'"
)
MergeRequest
.
where
(
closed:
false
).
update_all
(
"state = 'opened'"
)
MergeRequest
.
where
(
closed:
true
,
merged:
true
).
update_all
(
state: :merged
)
MergeRequest
.
where
(
closed:
true
,
merged:
false
).
update_all
(
state: :closed
)
MergeRequest
.
where
(
closed:
false
).
update_all
(
state: :opened
)
end
end
...
...
db/migrate/20130218141344_convert_closed_to_state_in_milestone.rb
View file @
4a55c698
class
ConvertClosedToStateInMilestone
<
ActiveRecord
::
Migration
def
up
Milestone
.
transaction
do
Milestone
.
where
(
closed:
false
).
update_all
(
"state = 'opened'"
)
Milestone
.
where
(
closed:
false
).
update_all
(
"state = 'active'"
)
Milestone
.
where
(
closed:
true
).
update_all
(
state: :closed
)
Milestone
.
where
(
closed:
false
).
update_all
(
state: :active
)
end
end
def
down
Milestone
.
transaction
do
Milestone
.
where
(
state: :closed
).
update_all
(
"closed = 1"
)
Milestone
.
where
(
state: :closed
).
update_all
(
closed:
true
)
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