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

Add SQLAlchemy models to Alembic; Include alembic-verify in the CI pipeline #122

Open
agennadi opened this issue Dec 16, 2024 · 0 comments

Comments

@agennadi
Copy link
Collaborator

Context

  • Current alembic migration script does not include SQLAlchemy models. They need to be included to reflect the actual database schema.
  • To catch mismatches between SQLAlchemy models and migrations early, alembic-verify should be introduced in the CI pipeline.
  • To avoid future discrepancies, the database URL shouldn't be hardcoded in alembic.ini, use env variables instead.

Definition of Done

  1. Address, Soft Story, Seismic, Tsunami, Liquefaction and Landslide tables are included in the migration script.
  2. The CI pipeline runs successfully and compares the SQLAlchemy models and migrations (might be blocked by Automate ETL Script Execution on Docker Build #118).
  3. The DATABASE_URL_SQLALCHEMY is imported from .env and defined in env.py

Engineering Details

  1. Run the backend/database/init_db.py in docker to initialize the SQLAlchemy models before updating the migration script.
  2. The env variables should be exported from backend/api/config.py. Use this tutorial to import the URL into alembic.
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

1 participant