BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
41abef8d
Commit
41abef8d
authored
Jan 24, 2017
by
Robert Speicher
Committed by
Robert Speicher
Jan 27, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Merge branch 'add-existence-checks-in-backported-migrations-ce' into 'master'
Make the time estimate migrations reversible See merge request !8749
parent
33e7ab9f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
2 deletions
+16
-2
20161223034433_add_estimate_to_issuables_ce.rb
db/migrate/20161223034433_add_estimate_to_issuables_ce.rb
+11
-1
20161223034646_create_timelogs_ce.rb
db/migrate/20161223034646_create_timelogs_ce.rb
+5
-1
No files found.
db/migrate/20161223034433_add_estimate_to_issuables_ce.rb
View file @
41abef8d
...
...
@@ -3,7 +3,7 @@ class AddEstimateToIssuablesCe < ActiveRecord::Migration
DOWNTIME
=
false
def
change
def
up
unless
column_exists?
(
:issues
,
:time_estimate
)
add_column
:issues
,
:time_estimate
,
:integer
end
...
...
@@ -12,4 +12,14 @@ class AddEstimateToIssuablesCe < ActiveRecord::Migration
add_column
:merge_requests
,
:time_estimate
,
:integer
end
end
def
down
if
column_exists?
(
:issues
,
:time_estimate
)
remove_column
:issues
,
:time_estimate
end
if
column_exists?
(
:merge_requests
,
:time_estimate
)
remove_column
:merge_requests
,
:time_estimate
end
end
end
db/migrate/20161223034646_create_timelogs_ce.rb
View file @
41abef8d
...
...
@@ -3,7 +3,7 @@ class CreateTimelogsCe < ActiveRecord::Migration
DOWNTIME
=
false
def
change
def
up
unless
table_exists?
(
:timelogs
)
create_table
:timelogs
do
|
t
|
t
.
integer
:time_spent
,
null:
false
...
...
@@ -17,4 +17,8 @@ class CreateTimelogsCe < ActiveRecord::Migration
add_index
:timelogs
,
:user_id
end
end
def
down
drop_table
:timelogs
if
table_exists?
(
:timelogs
)
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