Skip to content
Snippets Groups Projects
Commit 45ee9009 authored by Douwe Maan's avatar Douwe Maan
Browse files

Fix migration SQL.

parent 175f7f68
No related branches found
No related tags found
1 merge request!438Don't allow username to end in period.
Pipeline #
Loading
@@ -37,7 +37,7 @@ class RemovePeriodsAtEndsOfUsernames < ActiveRecord::Migration
Loading
@@ -37,7 +37,7 @@ class RemovePeriodsAtEndsOfUsernames < ActiveRecord::Migration
   
username = quote_string(username) username = quote_string(username)
execute "UPDATE users SET username = '#{username}' WHERE id = #{user["id"]}" execute "UPDATE users SET username = '#{username}' WHERE id = #{user["id"]}"
execute "UPDATE namespaces SET path = '#{username}', name = '#{username}' WHERE type = NULL AND owner_id = #{user["id"]}" execute "UPDATE namespaces SET path = '#{username}', name = '#{username}' WHERE type IS NULL AND owner_id = #{user["id"]}"
end end
   
select_all("SELECT id, path FROM namespaces WHERE type = 'Group' AND path LIKE '%.'").each do |group| select_all("SELECT id, path FROM namespaces WHERE type = 'Group' AND path LIKE '%.'").each do |group|
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment