diff options
author | Jeremy Kerr <jk@ozlabs.org> | 2010-08-12 12:15:48 +0800 |
---|---|---|
committer | Jeremy Kerr <jk@ozlabs.org> | 2011-04-14 16:44:53 +0800 |
commit | 56e2243f3be7e859666ce0e4e1a8b8b94444f8d4 (patch) | |
tree | 7d3cf84b990a1b732d0334c5520f3203a955df12 /lib/sql | |
parent | c3291f5d18445cd91b540342d31d76254b32376c (diff) | |
download | patchwork-56e2243f3be7e859666ce0e4e1a8b8b94444f8d4.tar.bz2 patchwork-56e2243f3be7e859666ce0e4e1a8b8b94444f8d4.tar.xz |
Use generic email confirmation object
Rather than having a UserPerson-specific confirmation, add an
EmailConfirmation object to allow multiple types of confirmations (eg,
opt-out requests in future).
To do this, we use a view (patchwork.views.confirm) that will call the
type-specific view with the confirmation object.
Also, add tests to check that the User/Person linkage system works.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Diffstat (limited to 'lib/sql')
-rw-r--r-- | lib/sql/grant-all.mysql.sql | 2 | ||||
-rw-r--r-- | lib/sql/grant-all.postgres.sql | 4 | ||||
-rw-r--r-- | lib/sql/migration/008-confirmations.sql | 11 |
3 files changed, 14 insertions, 3 deletions
diff --git a/lib/sql/grant-all.mysql.sql b/lib/sql/grant-all.mysql.sql index 4dd6efb..f60c6b8 100644 --- a/lib/sql/grant-all.mysql.sql +++ b/lib/sql/grant-all.mysql.sql @@ -12,7 +12,7 @@ GRANT SELECT, UPDATE, INSERT, DELETE ON auth_user_groups TO 'www-data'@localhost GRANT SELECT, UPDATE, INSERT, DELETE ON auth_group TO 'www-data'@localhost; GRANT SELECT, UPDATE, INSERT, DELETE ON auth_user_user_permissions TO 'www-data'@localhost; GRANT SELECT, UPDATE, INSERT, DELETE ON auth_permission TO 'www-data'@localhost; -GRANT SELECT, UPDATE, INSERT, DELETE ON patchwork_userpersonconfirmation TO 'www-data'@localhost; +GRANT SELECT, UPDATE, INSERT, DELETE ON patchwork_emailconfirmation TO 'www-data'@localhost; GRANT SELECT, UPDATE, INSERT, DELETE ON patchwork_state TO 'www-data'@localhost; GRANT SELECT, UPDATE, INSERT, DELETE ON patchwork_comment TO 'www-data'@localhost; GRANT SELECT, UPDATE, INSERT, DELETE ON patchwork_person TO 'www-data'@localhost; diff --git a/lib/sql/grant-all.postgres.sql b/lib/sql/grant-all.postgres.sql index 6a1a47d..47c4ad3 100644 --- a/lib/sql/grant-all.postgres.sql +++ b/lib/sql/grant-all.postgres.sql @@ -13,7 +13,7 @@ GRANT SELECT, UPDATE, INSERT, DELETE ON auth_group, auth_user_user_permissions, auth_permission, - patchwork_userpersonconfirmation, + patchwork_emailconfirmation, patchwork_state, patchwork_comment, patchwork_person, @@ -43,7 +43,7 @@ GRANT SELECT, UPDATE ON patchwork_person_id_seq, patchwork_project_id_seq, patchwork_state_id_seq, - patchwork_userpersonconfirmation_id_seq, + patchwork_emailconfirmation_id_seq, patchwork_userprofile_id_seq, patchwork_userprofile_maintainer_projects_id_seq, registration_registrationprofile_id_seq diff --git a/lib/sql/migration/008-confirmations.sql b/lib/sql/migration/008-confirmations.sql new file mode 100644 index 0000000..89437a2 --- /dev/null +++ b/lib/sql/migration/008-confirmations.sql @@ -0,0 +1,11 @@ +BEGIN; +ALTER TABLE "patchwork_userpersonconfirmation" + RENAME TO "patchwork_emailconfirmation"; +ALTER SEQUENCE "patchwork_userpersonconfirmation_id_seq" + RENAME TO "patchwork_emailconfirmation_id_seq"; +ALTER TABLE "patchwork_emailconfirmation" + ALTER COLUMN "user_id" DROP NOT NULL, + ADD COLUMN "type" varchar(20) NOT NULL DEFAULT 'userperson'; +ALTER TABLE "patchwork_emailconfirmation" + ALTER COLUMN "type" DROP DEFAULT; +COMMIT; |