Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing migration for the daily round model update #1499

Closed
Bhavik-ag opened this issue Aug 2, 2023 · 9 comments · Fixed by #1501
Closed

Missing migration for the daily round model update #1499

Bhavik-ag opened this issue Aug 2, 2023 · 9 comments · Fixed by #1501

Comments

@Bhavik-ag
Copy link
Contributor

Problem

  • Missing migration for the daily round model update done in 2e12108
@rithviknishad
Copy link
Member

@sainak should we add a CI to test if any migrations are missing in the future?

@rithviknishad
Copy link
Member

cc: @vigneshhari

@sainak
Copy link
Member

sainak commented Aug 2, 2023

There is a precommit hook for it
We can add that as well

@Ashesh3
Copy link
Member

Ashesh3 commented Aug 2, 2023

There is a precommit hook for it
We can add that as well

Do we already have that? I already have precommit hooks installed and I don't remember seeing any such error when missing the migration..

@rithviknishad
Copy link
Member

I think he meant that "there is a pre-commit hook that can be configured"

@rithviknishad
Copy link
Member

@sainak I tried running a local pre-commit to run ./manage.py makemigrations --check --dry-run

This works fine when running via CLI (git commit -m ...), but fails to run when commiting from vscode git extension. Failed to import Django.

@Ashesh3
Copy link
Member

Ashesh3 commented Aug 3, 2023

@sainak I tried running a local pre-commit to run ./manage.py makemigrations --check --dry-run

This works fine when running via CLI (git commit -m ...), but fails to run when commiting from vscode git extension. Failed to import Django.

Does the vscode git command run outside the context of the current virtual environment, hence the failing import?

@rithviknishad
Copy link
Member

it has got something to do with this actually

image

@sainak
Copy link
Member

sainak commented Aug 3, 2023

@sainak I tried running a local pre-commit to run ./manage.py makemigrations --check --dry-run

This works fine when running via CLI (git commit -m ...), but fails to run when commiting from vscode git extension. Failed to import Django.

Does the vscode git command run outside the context of the current virtual environment, hence the failing import?

Yes precommit creates virtual env for each hook and uses that by default
If you want to run checks with local packages use the system type for hooks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants