Make migrations reversible
This commit is contained in:
parent
93a2cc095b
commit
3e6181db14
2 changed files with 9 additions and 2 deletions
|
@ -1,7 +1,11 @@
|
|||
class AddDefaultProjectVisibililtyToApplicationSettings < ActiveRecord::Migration
|
||||
def change
|
||||
def up
|
||||
add_column :application_settings, :default_project_visibility, :integer
|
||||
visibility = Settings.gitlab.default_projects_features['visibility_level']
|
||||
execute("update application_settings set default_project_visibility = #{visibility}")
|
||||
end
|
||||
|
||||
def down
|
||||
remove_column :application_settings, :default_project_visibility
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
class RemoveAbandonedGroupMembersRecords < ActiveRecord::Migration
|
||||
def change
|
||||
def up
|
||||
execute("DELETE FROM members WHERE type = 'GroupMember' AND source_id NOT IN(\
|
||||
SELECT id FROM namespaces WHERE type='Group')")
|
||||
end
|
||||
|
||||
def down
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue