Skip to content
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

Automate database migrations #207

Open
eatyourgreens opened this issue Nov 20, 2024 · 4 comments
Open

Automate database migrations #207

eatyourgreens opened this issue Nov 20, 2024 · 4 comments

Comments

@eatyourgreens
Copy link
Contributor

eatyourgreens commented Nov 20, 2024

Database changes are currently made by hand on the running database (see #206.) Alembic looks like a good choice for managing migrations with SQLAlchemy.
https://alembic.sqlalchemy.org/en/latest/

@tomalrussell
Copy link
Member

cc @mz8i for infra-risk-vis/backend - perhaps one of you could write the patch for both?

@mz8i
Copy link
Contributor

mz8i commented Nov 21, 2024

It seems that there is a lot of overlapping work to be done on the API for both projects (this issue, #126 , nismod/infra-risk-vis#188 ) - is this a good moment to consider having the backend API as a shared project?
The challenge I think is that while the API code (especially for the features/attributes endpoints) has stayed fairly the same, the way it's deployed and ran has changed completely (would you say that's correct @tomalrussell ?).

It's probably worth adding that for the infra-ris-vis backend, we have the auto-generated https://github.com/nismod/irv-api-client-ts which makes it a bit easier to use from the frontend (in case irv-jamaica was to be migrated to use the shared API)

@eatyourgreens
Copy link
Contributor Author

Since irv-jamaica is deployed via docker compose, I don't think it would be a big change to switch the image used by the backend service. The client is generated from http://localhost:8888/openapi.json, running the backend locally, so that shouldn't be a problem either, assuming that the endpoints and response types are more-or-less the same.

@tomalrussell
Copy link
Member

I think deployment is now pretty similar between the two.

The main difference is that infra-risk-vis/containers/backend has the terracotta tile service bundled in; this could be pulled out and kept in infra-risk-vis if we factor out an irv-backend (I don't think there's any cross-dependency between serving the raster tiles API and the features API.)

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

No branches or pull requests

3 participants