coronasafe / care

Care is a Digital Public Good enabling TeleICU & Decentralised Administration of Healthcare Capacity across States.
https://careapi.ohc.network/swagger
MIT License
224 stars 256 forks source link

Add additional shortcuts to the Makefile #2208

Open skks1212 opened 1 month ago

skks1212 commented 1 month ago

Is your feature request related to a problem? Please describe. Currently the Makefile only contains a limited number of commands. Commands like make migrate that are essential while development are not present.

Describe the solution you'd like

dhruv-goyal-10 commented 3 weeks ago

@skks1212 I think so the following code, covers the changes you suggested.

Commands like migrate, shell_plus & dbshell are covered under wildcard command. reset_test_db is covered separately.

# Reset the test database and apply migrations
reset_test_db:
    docker compose exec backend bash -c "python manage.py reset_db --noinput"
    docker compose exec backend bash -c "python manage.py migrate"

# Wildcard command to run any Django management command
%:
    docker compose exec backend bash -c "python manage.py $*"
skks1212 commented 1 week ago

@dhruv-goyal-10 would flags and additional data be passed down? For example make migrate facility 0001 should convert to python manage.py migrate facility 0001

dhruv-goyal-10 commented 1 week ago

@skks1212 Yep, it will be passed down if the entire command is passed as string.

In your case, make "migrate facility 0001" will work same as running python manage.py migrate facility 0001.

skks1212 commented 1 week ago

@dhruv-goyal-10 Thats nice, should I assign you to this issue?

dhruv-goyal-10 commented 4 days ago

@skks1212 Yep, you can assign me this issue.