Internal: DB migration system#235
Conversation
0e20798 to
74de308
Compare
|
The dependencies in requirements.txt files are frozen from official Debian / Ubuntu packages and should match the versions available in the distributions: https://packages.debian.org/bullseye/alembic If these versions cause an issue (missing important features), we can investigate their dependency trees to see if we should ship that library inside our .deb packages. |
|
Ok I'll have a look after Chicago, unless you need the feature asap. |
|
Requires conflict resolution. Has this any priority currently? Has someone experienced troubles recently because of this problem? |
Problem: some updates require to modify the DB models. Solution: add a migration system based on alembic (the SQLAlchemy migration system). Developers can now create migrations by running `alembic revision -m "<description>" --autogenerate`. The migrations are automatically run at startup time.
74de308 to
0d73fce
Compare
|
|
||
|
|
||
| def make_db_url(): | ||
| return f"sqlite:///{settings.EXECUTION_DATABASE}" |
There was a problem hiding this comment.
Would it make more sense to put this as a @property of the settings ?
class Settings(BaseSettings):
@property
def execution_database_url(self):
eturn f"sqlite:///{self.EXECUTION_DATABASE}"There was a problem hiding this comment.
Doesn't make a lot of difference, maybe the advantage is that the caller does not have to get the singleton himself.
|
Replaced with #304 since this Pull Requests uses a fork. |
Problem: some updates require to modify the DB models.
Solution: add a migration system based on alembic (the SQLAlchemy migration system).
Developers can now create migrations by running
alembic -c vm_supervisor/alembic.ini revision -m "<description>" --autogenerate.The migrations are automatically run at startup time.