summaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
authorSean McGivern <sean@mcgivern.me.uk>2016-10-21 12:51:44 +0000
committerSean McGivern <sean@mcgivern.me.uk>2016-10-21 12:51:44 +0000
commit6c09fbd889a2259f8e2db1927c4e0a3d4cdb01b4 (patch)
treed14b2910c41bb7cef16f1b07fc623b77bd75da67 /db
parent1e66061b1ec5fb11457abca0845c13551afa8258 (diff)
parent168197cd5a179c961301225626ac1a175f892782 (diff)
downloadgitlab-ce-6c09fbd889a2259f8e2db1927c4e0a3d4cdb01b4.tar.gz
Merge branch 'fix_project_member_access_levels' into 'master'
Fix project member access levels Migrate invalid project members (owner -> master) Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/18616 See merge request !6957
Diffstat (limited to 'db')
-rw-r--r--db/migrate/20161018124658_make_project_owners_masters.rb15
-rw-r--r--db/schema.rb2
2 files changed, 16 insertions, 1 deletions
diff --git a/db/migrate/20161018124658_make_project_owners_masters.rb b/db/migrate/20161018124658_make_project_owners_masters.rb
new file mode 100644
index 00000000000..a576bb7b622
--- /dev/null
+++ b/db/migrate/20161018124658_make_project_owners_masters.rb
@@ -0,0 +1,15 @@
+class MakeProjectOwnersMasters < ActiveRecord::Migration
+ include Gitlab::Database::MigrationHelpers
+
+ DOWNTIME = false
+
+ def up
+ update_column_in_batches(:members, :access_level, 40) do |table, query|
+ query.where(table[:access_level].eq(50).and(table[:source_type].eq('Project')))
+ end
+ end
+
+ def down
+ # do nothing
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
index a3c7fc2fd57..f5c01511195 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -843,7 +843,7 @@ ActiveRecord::Schema.define(version: 20161019213545) do
t.integer "builds_access_level"
t.datetime "created_at"
t.datetime "updated_at"
- t.integer "repository_access_level", default: 20, null: false
+ t.integer "repository_access_level", default: 20, null: false
end
add_index "project_features", ["project_id"], name: "index_project_features_on_project_id", using: :btree