BigW Consortium Gitlab

Commit c74b49c2 by Robert Speicher

Merge branch 'rs-reversible-migrations' into 'master'

Make more migrations reversible See merge request !646
parents d0b1993b a9103eae
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
class RemoveImportDataFromProject < ActiveRecord::Migration
def change
def up
remove_column :projects, :import_data
end
def down
add_column :projects, :import_data, :text
end
end
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
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment