diff options
author | Jeremy Kerr <jk@ozlabs.org> | 2010-10-31 19:29:29 -0400 |
---|---|---|
committer | Jeremy Kerr <jk@ozlabs.org> | 2011-04-14 17:21:04 +0800 |
commit | c2c6a408c7764fa29389ce160f52776c9308d50a (patch) | |
tree | 1c47388b5494210aeed87f56f0c8b6e9fbeb4633 /lib/sql/migration | |
parent | 56e2243f3be7e859666ce0e4e1a8b8b94444f8d4 (diff) | |
download | patchwork-c2c6a408c7764fa29389ce160f52776c9308d50a.tar.bz2 patchwork-c2c6a408c7764fa29389ce160f52776c9308d50a.tar.xz |
registration: use EmailConfimation rather than separate registration app
Since we have infrastructure for email confirmations, we no longer need
the separate registration app.
Requires a migration script, which will delete all inactive users,
including those newly added and pending confirmation. Use carefully.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Diffstat (limited to 'lib/sql/migration')
-rw-r--r-- | lib/sql/migration/009-drop-registrationprofile.sql | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/lib/sql/migration/009-drop-registrationprofile.sql b/lib/sql/migration/009-drop-registrationprofile.sql new file mode 100644 index 0000000..f1c2b43 --- /dev/null +++ b/lib/sql/migration/009-drop-registrationprofile.sql @@ -0,0 +1,27 @@ +BEGIN; + +DELETE FROM registration_registrationprofile; + +-- unlink users who have contributed + +UPDATE patchwork_person SET user_id = NULL + WHERE user_id IN (SELECT id FROM auth_user WHERE is_active = False) + AND id IN (SELECT DISTINCT submitter_id FROM patchwork_comment); + +-- remove persons who only have a user linkage + +DELETE FROM patchwork_person WHERE user_id IN + (SELECT id FROM auth_user WHERE is_active = False); + +-- delete profiles + +DELETE FROM patchwork_userprofile WHERE user_id IN + (SELECT id FROM auth_user WHERE is_active = False); + +-- delete inactive users + +DELETE FROM auth_user WHERE is_active = False; + +DROP TABLE registration_registrationprofile; + +COMMIT; |