edh-elo/DEVELOPMENT.md
2024-11-18 19:47:40 -08:00

1.1 KiB

Pre-commit

This repo uses pre-commit. Install the tool with pip install pre-commit (or just pip install -r requirements-dev.txt), then install the hooks with pre-commit install

Not yet configured to run this in CI, as I'm the only contributor :P but I definitely should if I start getting contributions!

To wipe the database:

delete from elo_scores;
delete from games;
delete from decks;
delete from players;
alter sequence decks_id_seq restart with 1;
alter sequence games_id_seq restart with 1;
alter sequence players_id_seq restart with 1;
alter sequence elo_scores_id_seq restart with 1;

To make connection:

$ kubectl  -n edh-elo exec -it edh-elo-postgresql-0 -- psql -U db_user -d postgres

To copy the database out to local

$ docker cp edh-elo-server-1:/app/database/<name>

To add a new column to a table

  • Edit the appropriate classes in app/sql/models.py and app/sql/schemas.py
  • (If necessary) Update app/routers/seed.py:all_in_one

(TODO - investigate use of Alembic to model migrations)