0003_formatted_screen_name.up.sql 625 B

123456789101112131415161718192021222324252627
  1. -- call the new table "users" since it's not a reserved word that we'll need to
  2. -- deal with for postgres in the future.
  3. CREATE TABLE users
  4. (
  5. identScreenName VARCHAR(16) PRIMARY KEY,
  6. displayScreenName TEXT,
  7. authKey TEXT,
  8. strongMD5Pass TEXT,
  9. weakMD5Pass TEXT
  10. );
  11. INSERT INTO users
  12. SELECT LOWER(REPLACE(screenName, ' ', '')),
  13. screenName,
  14. authKey,
  15. strongMD5Pass,
  16. weakMD5Pass
  17. FROM user;
  18. DROP TABLE user;
  19. UPDATE feedbag
  20. SET name = LOWER(REPLACE(name, ' ', ''))
  21. WHERE classID IN (0, 2, 3);
  22. UPDATE feedbag
  23. SET screenName = LOWER(REPLACE(screenName, ' ', ''));