core (memory/sqla): database migration using Alembic:

Alembic database migration tool, which is the recommended one for SQLAlchemy has been
integrated. When a database is created, it will be used to stamp to current (head)
revision, otherwise, DB will be checked to see if it needs to be updated, and upgrade will
be triggered if necessary.
This commit is contained in:
Goffi 2021-06-25 17:55:23 +02:00
commit 8ae38a1131

View file

@ -223,7 +223,7 @@ class PasswordSessions(ProfileSessions):
)
class Memory(object):
class Memory:
"""This class manage all the persistent information"""
def __init__(self, host):
@ -241,10 +241,7 @@ class Memory(object):
self._cache_path = Path(self.getConfig("", "local_dir"), C.CACHE_DIR)
async def initialise(self):
database_file = os.path.expanduser(
os.path.join(self.getConfig("", "local_dir"), C.SAVEFILE_DATABASE)
)
self.storage = Storage(database_file, self.host.version)
self.storage = Storage()
await self.storage.initialise()
PersistentDict.storage = self.storage
self.params = Params(self.host, self.storage)