Fixes to get working out of the box

This commit is contained in:
Mo Balaa 2023-05-31 23:29:51 -05:00
parent b1b274be57
commit 0b0bf8a673
2 changed files with 6 additions and 4 deletions

View file

@ -699,7 +699,8 @@ class GPTBot:
self.matrix_client.store = matrix_store( self.matrix_client.store = matrix_store(
self.matrix_client.user_id, self.matrix_client.user_id,
self.matrix_client.device_id, self.matrix_client.device_id,
self.crypto_store_path or "", '.', #store path
database_name=self.crypto_store_path or "",
) )
self.matrix_client.olm = Olm( self.matrix_client.olm = Olm(

View file

@ -2,7 +2,8 @@ from collections import OrderedDict
from typing import Optional from typing import Optional
from importlib import import_module from importlib import import_module
from duckdb import DuckDBPyConnection from peewee import SqliteDatabase
MAX_MIGRATION = 8 MAX_MIGRATION = 8
@ -11,7 +12,7 @@ MIGRATIONS = OrderedDict()
for i in range(1, MAX_MIGRATION + 1): for i in range(1, MAX_MIGRATION + 1):
MIGRATIONS[i] = import_module(f".migration_{i}", __package__).migration MIGRATIONS[i] = import_module(f".migration_{i}", __package__).migration
def get_version(db: DuckDBPyConnection) -> int: def get_version(db: SqliteDatabase) -> int:
"""Get the current database version. """Get the current database version.
Args: Args:
@ -26,7 +27,7 @@ def get_version(db: DuckDBPyConnection) -> int:
except: except:
return 0 return 0
def migrate(db: DuckDBPyConnection, from_version: Optional[int] = None, to_version: Optional[int] = None) -> None: def migrate(db: SqliteDatabase, from_version: Optional[int] = None, to_version: Optional[int] = None) -> None:
"""Migrate the database to a specific version. """Migrate the database to a specific version.
Args: Args: