mlco2 / codecarbon

Track emissions from Compute and recommend ways to reduce their impact on the environment.
https://mlco2.github.io/codecarbon
MIT License
1k stars 157 forks source link

chore(db): alembic revision to remove teams #591

Closed inimaz closed 1 week ago

inimaz commented 1 week ago

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 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