Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRémy Coutable <remy@rymai.me>2017-01-24 19:12:55 +0300
committerRémy Coutable <remy@rymai.me>2017-01-24 19:15:37 +0300
commit929c20c2bc851c084e81713441a73c82174556a0 (patch)
treeb0d1e280d4fe0db49fb65fc0b0444cfe876e5a02 /db/migrate/20161223034646_create_timelogs_ce.rb
parentc66c3a46b508954fef6de41441d5a30eb3083f85 (diff)
Make the time estimate migrations reversible
Signed-off-by: Rémy Coutable <remy@rymai.me>
Diffstat (limited to 'db/migrate/20161223034646_create_timelogs_ce.rb')
-rw-r--r--db/migrate/20161223034646_create_timelogs_ce.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/db/migrate/20161223034646_create_timelogs_ce.rb b/db/migrate/20161223034646_create_timelogs_ce.rb
index e8a4b406012..66d9cd823fb 100644
--- a/db/migrate/20161223034646_create_timelogs_ce.rb
+++ b/db/migrate/20161223034646_create_timelogs_ce.rb
@@ -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