mirror of
https://github.com/jupyterhub/jupyterhub.git
synced 2025-10-15 05:53:00 +00:00
move check after engine creation
This commit is contained in:
@@ -651,8 +651,6 @@ def new_session_factory(url="sqlite:///:memory:",
|
||||
|
||||
elif url.startswith('mysql'):
|
||||
kwargs.setdefault('pool_recycle', 60)
|
||||
if mysql_large_prefix_check(engine): # if mysql is allows large indexes
|
||||
add_row_format(Base) # set format on the tables
|
||||
|
||||
if url.endswith(':memory:'):
|
||||
# If we're using an in-memory database, ensure that only one connection
|
||||
@@ -663,6 +661,8 @@ def new_session_factory(url="sqlite:///:memory:",
|
||||
if reset:
|
||||
Base.metadata.drop_all(engine)
|
||||
|
||||
if mysql_large_prefix_check(engine): # if mysql is allows large indexes
|
||||
add_row_format(Base) # set format on the tables
|
||||
# check the db revision (will raise, pointing to `upgrade-db` if version doesn't match)
|
||||
check_db_revision(engine)
|
||||
|
||||
|
Reference in New Issue
Block a user