summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTiago Botelho <tiagonbotelho@hotmail.com>2018-05-23 14:46:38 +0100
committerTiago Botelho <tiagonbotelho@hotmail.com>2018-05-23 14:46:38 +0100
commit9b058b8d42a089a6061e9f670aa8e126f44209e1 (patch)
tree5254695f96e36e014c519aea0cb69bd9ed490a05
parent2fdf15dd9784dd9cef76ab62ea36a3d165fa9bec (diff)
downloadgitlab-ce-9b058b8d42a089a6061e9f670aa8e126f44209e1.tar.gz
Adds migration to ensure the new project_mirror_data columns are indeed added to the table
-rw-r--r--db/migrate/20180503175053_add_missing_columns_to_project_mirror_data.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/db/migrate/20180503175053_add_missing_columns_to_project_mirror_data.rb b/db/migrate/20180503175053_add_missing_columns_to_project_mirror_data.rb
new file mode 100644
index 00000000000..030bb7662c3
--- /dev/null
+++ b/db/migrate/20180503175053_add_missing_columns_to_project_mirror_data.rb
@@ -0,0 +1,15 @@
+class AddMissingColumnsToProjectMirrorData < ActiveRecord::Migration
+ include Gitlab::Database::MigrationHelpers
+
+ DOWNTIME = false
+
+ def up
+ add_column :project_mirror_data, :status, :string unless column_exists?(:project_mirror_data, :status)
+ add_column :project_mirror_data, :jid, :string unless column_exists?(:project_mirror_data, :jid)
+ add_column :project_mirror_data, :last_error, :text unless column_exists?(:project_mirror_data, :last_error)
+ end
+
+ def down
+ # db/migrate/20180502122856_create_project_mirror_data.rb will remove the table
+ end
+end