summaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
authorRobert Speicher <rspeicher@gmail.com>2015-05-13 11:02:30 -0400
committerRobert Speicher <rspeicher@gmail.com>2015-05-13 11:03:29 -0400
commita9103eae3a2e92517d01f82aeaa923983420916f (patch)
tree6d4d6dbb59e20a5c5ffd9b3a52809d678a22816b /db
parentcc0a4b7ee896a1d0ca1b0d50d6d4f9f9b480e3d0 (diff)
downloadgitlab-ce-a9103eae3a2e92517d01f82aeaa923983420916f.tar.gz
Make more migrations reversiblers-reversable-migrations
[ci skip]
Diffstat (limited to 'db')
-rw-r--r--db/migrate/20150406133311_add_invite_data_to_member.rb13
-rw-r--r--db/migrate/20150417122318_remove_import_data_from_project.rb6
-rw-r--r--db/migrate/20150425173433_add_default_snippet_visibility_to_app_settings.rb6
3 files changed, 22 insertions, 3 deletions
diff --git a/db/migrate/20150406133311_add_invite_data_to_member.rb b/db/migrate/20150406133311_add_invite_data_to_member.rb
index 3452fd45c4f..5d3e856ddce 100644
--- a/db/migrate/20150406133311_add_invite_data_to_member.rb
+++ b/db/migrate/20150406133311_add_invite_data_to_member.rb
@@ -1,5 +1,5 @@
class AddInviteDataToMember < ActiveRecord::Migration
- def change
+ def up
add_column :members, :created_by_id, :integer
add_column :members, :invite_email, :string
add_column :members, :invite_token, :string
@@ -9,4 +9,15 @@ class AddInviteDataToMember < ActiveRecord::Migration
add_index :members, :invite_token, unique: true
end
+
+ def down
+ remove_index :members, :invite_token
+
+ change_column :members, :user_id, :integer, null: false
+
+ remove_column :members, :invite_accepted_at
+ remove_column :members, :invite_token
+ remove_column :members, :invite_email
+ remove_column :members, :created_by_id
+ end
end
diff --git a/db/migrate/20150417122318_remove_import_data_from_project.rb b/db/migrate/20150417122318_remove_import_data_from_project.rb
index c275b49d228..46cf63593c9 100644
--- a/db/migrate/20150417122318_remove_import_data_from_project.rb
+++ b/db/migrate/20150417122318_remove_import_data_from_project.rb
@@ -1,5 +1,9 @@
class RemoveImportDataFromProject < ActiveRecord::Migration
- def change
+ def up
remove_column :projects, :import_data
end
+
+ def down
+ add_column :projects, :import_data, :text
+ end
end
diff --git a/db/migrate/20150425173433_add_default_snippet_visibility_to_app_settings.rb b/db/migrate/20150425173433_add_default_snippet_visibility_to_app_settings.rb
index 51237354d9f..8f1b0cc8935 100644
--- a/db/migrate/20150425173433_add_default_snippet_visibility_to_app_settings.rb
+++ b/db/migrate/20150425173433_add_default_snippet_visibility_to_app_settings.rb
@@ -1,7 +1,11 @@
class AddDefaultSnippetVisibilityToAppSettings < ActiveRecord::Migration
- def change
+ def up
add_column :application_settings, :default_snippet_visibility, :integer
visibility = Settings.gitlab.default_projects_features['visibility_level']
execute("update application_settings set default_snippet_visibility = #{visibility}")
end
+
+ def down
+ remove_column :application_settings, :default_snippet_visibility
+ end
end