Add data column to sessions table for session storage

parent 1b7752ba
......@@ -533,6 +533,16 @@ def init_db(conn) -> None:
# Column might already exist
pass
# Add data column to sessions table if it doesn't exist
try:
if config['type'] == 'mysql':
cursor.execute('ALTER TABLE sessions ADD COLUMN data LONGTEXT')
else:
cursor.execute('ALTER TABLE sessions ADD COLUMN data TEXT')
except:
# Column might already exist
pass
# Insert default admin user if not exist
import hashlib
default_password = hashlib.sha256('admin'.encode()).hexdigest()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment