Browse Source

Fixes to get working out of the box

Mo Balaa 1 year ago
parent
commit
0b0bf8a673
2 changed files with 6 additions and 4 deletions
  1. 2 1
      src/gptbot/classes/bot.py
  2. 4 3
      src/gptbot/migrations/__init__.py

+ 2 - 1
src/gptbot/classes/bot.py

@@ -699,7 +699,8 @@ class GPTBot:
             self.matrix_client.store = matrix_store(
                 self.matrix_client.user_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(

+ 4 - 3
src/gptbot/migrations/__init__.py

@@ -2,7 +2,8 @@ from collections import OrderedDict
 from typing import Optional
 from importlib import import_module
 
-from duckdb import DuckDBPyConnection
+from peewee import SqliteDatabase
+
 
 MAX_MIGRATION = 8
 
@@ -11,7 +12,7 @@ MIGRATIONS = OrderedDict()
 for i in range(1, MAX_MIGRATION + 1):
     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.
 
     Args:
@@ -26,7 +27,7 @@ def get_version(db: DuckDBPyConnection) -> int:
     except:
         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.
 
     Args: