SHOW DATABASES LIKE

This commit is contained in:
jysperm
2014-07-23 05:09:26 +08:00
parent 9178faaf0a
commit 9553e3e99f

View File

@@ -24,10 +24,10 @@ module.exports =
connection.query "DROP USER '#{account.username}'@'localhost';", (err, rows) ->
throw err if err
connection.query 'show databases;', (err, rows) ->
connection.query "SHOW DATABASES LIKE '#{account.username}_%';", (err, rows) ->
throw err if err
databases_to_delete = _.filter _.pluck(rows, 'Database'), (item) ->
databases_to_delete = _.filter _.pluck(rows, "Database (#{account.username}_%)"), (item) ->
if item[..account.username.length] == "#{account.username}_"
return true
else