diff options
author | Christopher Allan Webber <cwebber@dustycloud.org> | 2015-02-17 20:04:15 -0600 |
---|---|---|
committer | Christopher Allan Webber <cwebber@dustycloud.org> | 2015-02-17 20:04:15 -0600 |
commit | 941b9abbb03dbc6fb91975a5f4bf5ea6b4997d17 (patch) | |
tree | 105b9f83f7abb00f54ceec404ce94567c6129623 | |
parent | d180c131c34e3c3142253f7d97f614d4826902ab (diff) | |
download | mediagoblin-941b9abbb03dbc6fb91975a5f4bf5ea6b4997d17.tar.lz mediagoblin-941b9abbb03dbc6fb91975a5f4bf5ea6b4997d17.tar.xz mediagoblin-941b9abbb03dbc6fb91975a5f4bf5ea6b4997d17.zip |
Fix the token issues in the migration
There's no .id on access/request token tables, so fixed to use the .token field.
Also switched a reference of client_table -> rt_table
-rw-r--r-- | mediagoblin/db/migrations.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/mediagoblin/db/migrations.py b/mediagoblin/db/migrations.py index 8e54953e..74c1194f 100644 --- a/mediagoblin/db/migrations.py +++ b/mediagoblin/db/migrations.py @@ -1162,10 +1162,10 @@ def datetime_to_utc(db): # Convert RequestToken rt_table = inspect_table(metadata, "core__request_tokens") for request_token in db.execute(rt_table.select()): - db.execute(client_table.update().values( + db.execute(rt_table.update().values( created=dt_to_utc(request_token.created), updated=dt_to_utc(request_token.updated) - ).where(rt_table.c.id==request_token.id)) + ).where(rt_table.c.token==request_token.token)) # Convert AccessToken at_table = inspect_table(metadata, "core__access_tokens") @@ -1173,7 +1173,7 @@ def datetime_to_utc(db): db.execute(at_table.update().values( created=dt_to_utc(access_token.created), updated=dt_to_utc(access_token.updated) - ).where(at_table.c.id==access_token.id)) + ).where(at_table.c.token==access_token.token)) # Convert MediaEntry media_table = inspect_table(metadata, "core__media_entries") |