Skip to content

Commit

Permalink
i2b2pm: audit dates include time
Browse files Browse the repository at this point in the history
It didn't work, but this was an attempt to deal with...
xerial/sqlite-jdbc#88 JDBC driver unable to parse ISO 8601 dates

--HG--
branch : jvm_deploy_254
  • Loading branch information
dckc committed Apr 19, 2019
1 parent f9cd19c commit 24a51f8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions heron_wsgi/admin_lib/i2b2pm.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@
from injector import inject, provides, singleton
from sqlalchemy import Column, ForeignKey, and_
from sqlalchemy import func, orm
from sqlalchemy.types import String, Date, Enum
from sqlalchemy.types import String, DateTime, Enum
from sqlalchemy.ext.declarative import declarative_base

import rtconfig
Expand Down Expand Up @@ -273,7 +273,7 @@ def authz(self, uid, full_name,
log.debug('generate authorization for: %s', (uid, full_name))
ds = self._datasrc()

t = func.now()
t = func.current_timestamp()
auth = str(self._uuidgen.uuid4())
pw_hash = hexdigest(auth)

Expand Down Expand Up @@ -365,8 +365,8 @@ def creds(self):


class Audited(object):
change_date = Column(Date)
entry_date = Column(Date)
change_date = Column(DateTime)
entry_date = Column(DateTime)
changeby_char = Column(String) # foreign key?
status_cd = Column(Enum('A', 'D'))

Expand Down Expand Up @@ -410,7 +410,7 @@ class UserSession(Base, Audited):
user_id = Column(String,
ForeignKey('pm_user_data.user_id'),
primary_key=True)
expired_date = Column(Date)
expired_date = Column(DateTime)

def __repr__(self):
return "<UserSession(%s, %s)>" % (self.user_id,
Expand Down
4 changes: 2 additions & 2 deletions heron_wsgi/admin_lib/sqlite_mem.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@

def _test_engine():
sqlite3 # mark used
return create_mem_engine(memory)
return create_mem_engine(memory, native_datetime=True)
except ImportError:
from jdbc_test import SqliteJDBC

def _test_engine():
return create_mem_engine(memory, module=SqliteJDBC)
return create_mem_engine(memory, module=SqliteJDBC, native_datetime=True)

0 comments on commit 24a51f8

Please sign in to comment.