summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2008-12-14 12:31:26 +0100
committerYorhel <git@yorhel.nl>2008-12-14 12:31:26 +0100
commit9df687dd43c9060aa4b48601f924457fa2c39926 (patch)
tree2adb57353fdea2eca9bdd56c92f511f9e1dd7991 /util
parentd85da4dfaa971c5244bc26d52ca517d6190f0fdb (diff)
Getting rid of all leading and trailing whitespace and newlines in the DB
YAWF's formValidate() automatically removes them from all input, which could result in a few unexpected changes when editing a v/r/p entry.
Diffstat (limited to 'util')
-rw-r--r--util/updates/update_2.0.sql14
1 files changed, 7 insertions, 7 deletions
diff --git a/util/updates/update_2.0.sql b/util/updates/update_2.0.sql
index 6862463d..f371c4de 100644
--- a/util/updates/update_2.0.sql
+++ b/util/updates/update_2.0.sql
@@ -60,18 +60,18 @@ ALTER TABLE users DROP COLUMN flags;
--- get rid of \r
+-- get rid of \r and leading and trailing whitespace
UPDATE vn_rev
- SET "desc" = translate("desc", E'\r', ''),
- alias = translate(alias, E'\r', '');
+ SET "desc" = trim(both E'\n ' from translate("desc", E'\r', '')),
+ alias = trim(both E'\n ' from translate(alias, E'\r', ''));
UPDATE releases_rev
- SET notes = translate(notes, E'\r', '');
+ SET notes = trim(both E'\n ' from translate(notes, E'\r', ''));
UPDATE producers_rev
- SET "desc" = translate("desc", E'\r', '');
+ SET "desc" = trim(both E'\n ' from translate("desc", E'\r', ''));
UPDATE changes
- SET comments = translate(comments, E'\r', '');
+ SET comments = trim(both E'\n ' from translate(comments, E'\r', ''));
UPDATE threads_posts
- SET msg = translate(msg, E'\r', '');
+ SET msg = trim(both E'\n ' from translate(msg, E'\r', ''));