aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/db
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
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')
-rw-r--r--mediagoblin/db/migrations.py20
-rw-r--r--mediagoblin/db/models.py3
2 files changed, 20 insertions, 3 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()
diff --git a/mediagoblin/db/models.py b/mediagoblin/db/models.py
index 2b925983..f5470cb9 100644
--- a/mediagoblin/db/models.py
+++ b/mediagoblin/db/models.py
@@ -68,12 +68,9 @@ class User(Base, UserMixin):
# set to nullable=True implicitly.
wants_comment_notification = Column(Boolean, default=True)
license_preference = Column(Unicode)
- verification_key = Column(Unicode)
is_admin = Column(Boolean, default=False, nullable=False)
url = Column(Unicode)
bio = Column(UnicodeText) # ??
- fp_verification_key = Column(Unicode)
- fp_token_expire = Column(DateTime)
## TODO
# plugin data would be in a separate model