Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@odesenfans
Copy link
Contributor

@odesenfans odesenfans commented Sep 28, 2022

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.

@hoh
Copy link
Member

hoh commented Oct 5, 2022

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
https://packages.debian.org/bullseye/py-cpuinfo

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.

@odesenfans
Copy link
Contributor Author

Ok I'll have a look after Chicago, unless you need the feature asap.

@MHHukiewitz
Copy link
Member

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.
@odesenfans odesenfans force-pushed the od-db-migration-system branch from 74de308 to 0d73fce Compare April 3, 2023 17:04


def make_db_url():
return f"sqlite:///{settings.EXECUTION_DATABASE}"
Copy link
Member

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}"

Copy link
Contributor Author

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.

@hoh
Copy link
Member

hoh commented May 10, 2023

Replaced with #304 since this Pull Requests uses a fork.

@hoh hoh closed this May 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants