Make more migrations reversible
[ci skip]
This commit is contained in:
parent
cc0a4b7ee8
commit
a9103eae3a
3 changed files with 22 additions and 3 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue