Adds migration for OAuth1 tables
authorxray7224 <jessica@megworld.co.uk>
Thu, 18 Jul 2013 19:21:35 +0000 (20:21 +0100)
committerxray7224 <jessica@megworld.co.uk>
Thu, 18 Jul 2013 19:24:35 +0000 (20:24 +0100)
mediagoblin/db/migrations.py

index fe4ffb3eda34dd319c8be3fc1df064e67b4e37c0..4673e0ce79cd37a245d279cc6eb2eef805a16338 100644 (file)
@@ -26,7 +26,9 @@ from sqlalchemy.sql import and_
 from migrate.changeset.constraint import UniqueConstraint
 
 from mediagoblin.db.migration_tools import RegisterMigration, inspect_table
-from mediagoblin.db.models import MediaEntry, Collection, User, MediaComment
+from mediagoblin.db.models import (MediaEntry, Collection, User, MediaComment,
+                                   Client, RequestToken, AccessToken,
+                                   NonceTimestamp)
 
 MIGRATIONS = {}
 
@@ -379,3 +381,15 @@ def pw_hash_nullable(db):
         constraint.create()
 
     db.commit()
+
+
+@RegisterMigration(14, MIGRATIONS)
+def create_oauth1_tables(db):
+    """ Creates the OAuth1 tables """
+
+    Client.__table__.create(db.bind)
+    RequestToken.__table__.create(db.bind)
+    AccessToken.__table__.create(db.bind)
+    NonceTimestamp.__table__.create(db.bind)
+
+    db.commit()