SanjinDedic / agent_games

Secure, extensible agent competition platform API build with FastAPI, SQLmodel, Pydantic and Docker
9 stars 2 forks source link

Test automated deployment and investigate alembic for updating changes to the database #80

Open SanjinDedic opened 2 months ago

SanjinDedic commented 2 months ago

Right now every commit that changes the db structure does not deploy automatically

We need to run production_database_setup.py

Even this is not smooth and I had permission issues both locally and on the server which needed this command and an update to get rid of pycache files

sudo chown -R ubuntu:ubuntu /home/ubuntu/agent_games

We need a solution which updates the server successfully when the db changes

SanjinDedic commented 2 months ago

The test for this solution would be to update this to have more custom values (lets say 5) and see if the change propagates properly

class SimulationResultItem(SQLModel, table=True):
    id: int = Field(primary_key=True, default=None)
    simulation_result_id: int = Field(foreign_key="simulationresult.id")
    simulation_result: SimulationResult = Relationship(back_populates="simulation_results")
    team_id: int = Field(foreign_key="team.id")
    team: Team = Relationship()
    score: float = 0
    custom_value1: float | None = None
    custom_value2: float | None = None
    custom_value3: float | None = None
    custom_value1_name: str | None = None
    custom_value2_name: str | None = None
    custom_value3_name: str | None = None