Skip to content
This repository has been archived by the owner on May 6, 2024. It is now read-only.

adding an sql script for sanitizing the prod mysql db #1052

Merged
merged 11 commits into from
May 2, 2014
Prev Previous commit
Next Next commit
syntax
  • Loading branch information
jarv committed Apr 29, 2014
commit 69e37175741afe28141858b36fbebf33f0e93ac4
12 changes: 6 additions & 6 deletions util/vpc-tools/sanitize-db.sql
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ SET FOREIGN_KEY_CHECKS=0;
UPDATE wwc.auth_user
set email = concat('success+',cast(id AS CHAR),'@simulator.amazonses.com')
where email not like ('%@edx.org'),
set username = concat('user-',cast(id AS CHAR)
set username = concat('user-',cast(id AS CHAR))
where email not like ('%@edx.org'),
set first_name = concat('user-',cast(id AS CHAR)
set first_name = concat('user-',cast(id AS CHAR))
where email not like ('%@edx.org'),
set last_name = concat('user-',cast(id AS CHAR)
set last_name = concat('user-',cast(id AS CHAR))
where email not like ('%@edx.org'),
set password = null
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a little surprised this is nullable.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's the default, maybe set it to an empty string instead?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it's nullable, I'm fine with this; I'm just surprised.

where email not like ('%@edx.org'),
Expand Down Expand Up @@ -62,11 +62,11 @@ UPDATE wwc.auth_userprofile
UPDATE prod_grader.auth_user
set email = concat('success+',cast(id AS CHAR),'@simulator.amazonses.com')
where email not like ('%@edx.org'),
set username = concat('user-',cast(id AS CHAR)
set username = concat('user-',cast(id AS CHAR))
where email not like ('%@edx.org'),
set first_name = concat('user-',cast(id AS CHAR)
set first_name = concat('user-',cast(id AS CHAR))
where email not like ('%@edx.org'),
set last_name = concat('user-',cast(id AS CHAR)
set last_name = concat('user-',cast(id AS CHAR))
where email not like ('%@edx.org'),
set password = null
where email not like ('%@edx.org'),
Expand Down