aboutsummaryrefslogtreecommitdiffstats
path: root/db
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2021-08-30 17:49:03 -0700
committerAdam Soltys <[email protected]>2021-08-30 19:35:36 -0700
commit3e61c801fc3ca9644304c88f86adf5aa297aeef4 (patch)
tree6eafce644f073b4cb85e5a79ac6c94133fc865b9 /db
parent8198ea6beec15f33015483cb911a58a0bc8f0d2e (diff)
downloadcoinos-server-3e61c801fc3ca9644304c88f86adf5aa297aeef4.tar.gz
coinos-server-3e61c801fc3ca9644304c88f86adf5aa297aeef4.zip
strip spaces from usernames
Diffstat (limited to 'db')
-rw-r--r--db/migrations/20210821013757_cull_usernames.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/db/migrations/20210821013757_cull_usernames.js b/db/migrations/20210821013757_cull_usernames.js
index a4a48f21..5d2a4672 100644
--- a/db/migrations/20210821013757_cull_usernames.js
+++ b/db/migrations/20210821013757_cull_usernames.js
@@ -1,8 +1,8 @@
exports.up = function(knex) {
return Promise.all([
- knex.raw("UPDATE users SET username = REPLACE(username, ' ', '') WHERE username like '% '"), // just in case valid users have trailing spaces in their username
- knex.raw("DELETE FROM users WHERE !(username REGEXP '^[a-zA-Z0-9\.\_\@\-]{3,32}$'"),
+ knex.raw("UPDATE users SET username = REPLACE(username, ' ', '')"), // just in case valid users have trailing spaces in their username
+ knex.raw("DELETE FROM users WHERE !(username REGEXP '^[a-zA-Z0-9\.\_\@\-]{3,32}$')"),
])
};