Skip to content

Commit

Permalink
Merge pull request #6057 from VJalili/alter_extra_data
Browse files Browse the repository at this point in the history
[18.05] Alter the type of extra_data column of OIDC table.
  • Loading branch information
dannon committed May 4, 2018
2 parents 3292445 + 5bd2cbd commit 1b41cbb
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
4 changes: 0 additions & 4 deletions lib/galaxy/model/__init__.py
Expand Up @@ -4727,10 +4727,6 @@ def get_access_token(self):
return self.extra_data.get('access_token', None) if self.extra_data is not None else None

def set_extra_data(self, extra_data=None):
# Note: the following unicode conversion is a temporary solution for a
# database binding error (InterfaceError: (sqlite3.InterfaceError)).
if extra_data is not None:
extra_data = str(extra_data)
if super(UserAuthnzToken, self).set_extra_data(extra_data):
self.trans.sa_session.add(self)
self.trans.sa_session.flush()
Expand Down
2 changes: 1 addition & 1 deletion lib/galaxy/model/mapping.py
Expand Up @@ -129,7 +129,7 @@
Column('user_id', Integer, ForeignKey("galaxy_user.id"), index=True),
Column('uid', VARCHAR(255)),
Column('provider', VARCHAR(32)),
Column('extra_data', TEXT),
Column('extra_data', JSONType, nullable=True),
Column('lifetime', Integer),
Column('assoc_type', VARCHAR(64)))

Expand Down
4 changes: 3 additions & 1 deletion lib/galaxy/model/migrate/versions/0141_add_oidc_tables.py
Expand Up @@ -7,6 +7,8 @@

from sqlalchemy import Column, ForeignKey, Integer, MetaData, Table, TEXT, VARCHAR

from galaxy.model.custom_types import JSONType

log = logging.getLogger(__name__)
metadata = MetaData()

Expand Down Expand Up @@ -51,7 +53,7 @@
Column('user_id', Integer, ForeignKey("galaxy_user.id"), index=True),
Column('uid', VARCHAR(255)),
Column('provider', VARCHAR(32)),
Column('extra_data', TEXT),
Column('extra_data', JSONType, nullable=True),
Column('lifetime', Integer),
Column('assoc_type', VARCHAR(64)))

Expand Down

0 comments on commit 1b41cbb

Please sign in to comment.