From a72679a9622db66e828e86377f29c9c0c6574d69 Mon Sep 17 00:00:00 2001
From: Jeremy Kerr <jk@ozlabs.org>
Date: Thu, 11 Sep 2008 16:42:26 +1000
Subject: Don't just rely on random for UserPersonConfirmation keys

It looks like we're getting identical keys generated for confirmation
keys. Problem has been reported to django, but in the meantime, salt
with the user and email details, then sha1 to give the final key.

This requires an increase in the field size for key, migration script
included.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
---
 lib/sql/migration/002-extend-userpersonconfirmation-key-length.sql | 4 ++++
 1 file changed, 4 insertions(+)
 create mode 100644 lib/sql/migration/002-extend-userpersonconfirmation-key-length.sql

(limited to 'lib/sql/migration/002-extend-userpersonconfirmation-key-length.sql')

diff --git a/lib/sql/migration/002-extend-userpersonconfirmation-key-length.sql b/lib/sql/migration/002-extend-userpersonconfirmation-key-length.sql
new file mode 100644
index 0000000..fa10fba
--- /dev/null
+++ b/lib/sql/migration/002-extend-userpersonconfirmation-key-length.sql
@@ -0,0 +1,4 @@
+BEGIN;
+ALTER TABLE patchwork_userpersonconfirmation
+        ALTER COLUMN key TYPE char(40);
+COMMIT;
-- 
cgit v1.2.3

