added sql model to db

This commit is contained in:
Jun-te Kim 2026-03-31 11:42:20 +00:00
parent a946eb2959
commit f8736d3574
2 changed files with 15 additions and 6 deletions

View file

@ -33,6 +33,17 @@ jobs:
- name: Build test image - name: Build test image
run: docker build -f Dockerfile.test -t model-test . run: docker build -f Dockerfile.test -t model-test .
- name: Initialise database schema
run: |
docker run --rm \
--network host \
-e DB_HOST=localhost \
-e DB_NAME=test \
-e DB_USERNAME=test \
-e DB_PASSWORD=test \
-e DB_PORT=5432 \
model-test python scripts/init_db.py
- name: Run tests - name: Run tests
run: | run: |
docker run --rm \ docker run --rm \

View file

@ -26,15 +26,13 @@ from backend.app.db.functions.materials_functions import get_materials
from collections import defaultdict from collections import defaultdict
from sqlalchemy import func from sqlalchemy import func
# PORTFOLIO_ID = 206 PORTFOLIO_ID = 639
# SCENARIOS = [389] SCENARIOS = [1157]
PORTFOLIO_ID = 633
SCENARIOS = [1146]
scenario_names = { scenario_names = {
1146: "Most Economic", 1157: "EPC C - no EWI solid floor",
} }
project_name = "WCHG EPC D rated properties" project_name = "Instagroup Sample"
def get_data(portfolio_id, scenario_ids): def get_data(portfolio_id, scenario_ids):