BigW Consortium Gitlab

Commit 071f07b6 by Valery Sizov

Merge branch 'fix_migration' into 'master'

Make migrations reversible /cc @jacobvosmaer @marin See merge request !622
parents 4a373be8 3e6181db
class AddDefaultProjectVisibililtyToApplicationSettings < ActiveRecord::Migration class AddDefaultProjectVisibililtyToApplicationSettings < ActiveRecord::Migration
def change def up
add_column :application_settings, :default_project_visibility, :integer add_column :application_settings, :default_project_visibility, :integer
visibility = Settings.gitlab.default_projects_features['visibility_level'] visibility = Settings.gitlab.default_projects_features['visibility_level']
execute("update application_settings set default_project_visibility = #{visibility}") execute("update application_settings set default_project_visibility = #{visibility}")
end end
def down
remove_column :application_settings, :default_project_visibility
end
end end
class RemoveAbandonedGroupMembersRecords < ActiveRecord::Migration class RemoveAbandonedGroupMembersRecords < ActiveRecord::Migration
def change def up
execute("DELETE FROM members WHERE type = 'GroupMember' AND source_id NOT IN(\ execute("DELETE FROM members WHERE type = 'GroupMember' AND source_id NOT IN(\
SELECT id FROM namespaces WHERE type='Group')") SELECT id FROM namespaces WHERE type='Group')")
end end
def down
end
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