diff options
Diffstat (limited to 'db')
-rw-r--r-- | db/migrate/20150429002313_remove_abandoned_group_members_records.rb | 6 | ||||
-rw-r--r-- | db/schema.rb | 2 |
2 files changed, 7 insertions, 1 deletions
diff --git a/db/migrate/20150429002313_remove_abandoned_group_members_records.rb b/db/migrate/20150429002313_remove_abandoned_group_members_records.rb new file mode 100644 index 00000000000..6013605bb35 --- /dev/null +++ b/db/migrate/20150429002313_remove_abandoned_group_members_records.rb @@ -0,0 +1,6 @@ +class RemoveAbandonedGroupMembersRecords < ActiveRecord::Migration + def change + execute("DELETE FROM members WHERE type = 'GroupMember' AND source_id NOT IN(\ + SELECT id FROM namespaces WHERE type='Group')") + end +end diff --git a/db/schema.rb b/db/schema.rb index 8683c0446fe..2530eb6fa9d 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20150425173433) do +ActiveRecord::Schema.define(version: 20150429002313) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" |