-
Notifications
You must be signed in to change notification settings - Fork 18
Internal: DB migration system #235
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.