aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/db/migrations.py
diff options
context:
space:
mode:
authorChristopher Allan Webber <cwebber@dustycloud.org>2013-06-21 15:50:36 -0500
committerChristopher Allan Webber <cwebber@dustycloud.org>2013-06-21 15:50:36 -0500
commitc482f0149d566156c4017fa58a8d57ffde90b1dc (patch)
tree10f9c9c6191f23fdf2059583d7ba68640e63cf7e /mediagoblin/db/migrations.py
parent92b22e7deac547835f69168f97012b52e87b6de4 (diff)
parent69b888c22c326b1e69ee8e050a415561b6ca6aac (diff)
downloadmediagoblin-c482f0149d566156c4017fa58a8d57ffde90b1dc.tar.lz
mediagoblin-c482f0149d566156c4017fa58a8d57ffde90b1dc.tar.xz
mediagoblin-c482f0149d566156c4017fa58a8d57ffde90b1dc.zip
Merge remote-tracking branch 'refs/remotes/rodney757-github/mail'
Diffstat (limited to 'mediagoblin/db/migrations.py')
-rw-r--r--mediagoblin/db/migrations.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/mediagoblin/db/migrations.py b/mediagoblin/db/migrations.py
index 2c553396..6c9bf5cc 100644
--- a/mediagoblin/db/migrations.py
+++ b/mediagoblin/db/migrations.py
@@ -287,3 +287,23 @@ def unique_collections_slug(db):
constraint.create()
db.commit()
+
+
+@RegisterMigration(11, MIGRATIONS)
+def drop_token_related_User_columns(db):
+ """
+ Drop unneeded columns from the User table after switching to using
+ itsdangerous tokens for email and forgot password verification.
+ """
+ metadata = MetaData(bind=db.bind)
+ user_table = inspect_table(metadata, 'core__users')
+
+ verification_key = user_table.columns['verification_key']
+ fp_verification_key = user_table.columns['fp_verification_key']
+ fp_token_expire = user_table.columns['fp_token_expire']
+
+ verification_key.drop()
+ fp_verification_key.drop()
+ fp_token_expire.drop()
+
+ db.commit()