Launch postgres with docker compose
docker-compose up -d postgres pgadmin
Run alembic to apply the latest schema
alembic -c carbonserver/database/alembic.ini upgrade head
Check in your browser ==> http://localhost:5080 that the resulted schema is the desired one.
To test the downgrade run
alembic -c carbonserver/database/alembic.ini downgrade 3f64cdda4d67
And then the upgrade again
alembic -c carbonserver/database/alembic.ini upgrade 7ace119b161f
Goal: have an alembic revision that removes the teams from the db
To see the diff in the sql models see this previous commit ==> https://github.com/mlco2/codecarbon/pull/573/files#diff-d4c9f4f116d325e1f420216f45ed54ab7777c5323bd89b2a923f115d65043e1c
How to test this
Launch postgres with docker compose
docker-compose up -d postgres pgadmin
Run alembic to apply the latest schemaalembic -c carbonserver/database/alembic.ini upgrade head
Check in your browser ==> http://localhost:5080 that the resulted schema is the desired one.To test the downgrade run
alembic -c carbonserver/database/alembic.ini downgrade 3f64cdda4d67
And then the upgrade again
alembic -c carbonserver/database/alembic.ini upgrade 7ace119b161f