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

fix: fix potential slow query on huge requestevent table #240

Merged
merged 1 commit into from
Jan 26, 2023
Merged

fix: fix potential slow query on huge requestevent table #240

merged 1 commit into from
Jan 26, 2023

Conversation

3cp
Copy link
Contributor

@3cp 3cp commented Sep 25, 2022

closes #239

@3cp
Copy link
Contributor Author

3cp commented Sep 25, 2022

A side layman question:
I am quite new to Django plugin development. In order to update the migration files, first I installed the project folder as a depenendy in my venv pip3 install ., then in the easyaudit/tests/ folder, I run python3 manage.py makemigrations easyaudit. That created new migration file in the venv installed site-packages folder.

Then I copied out the new migration file back to the project folder like this:

cp ../../venv/lib/python3.10/site-packages/easyaudit/migrations/0017_alter_requestevent_datetime.py ../migrations/

Is this the expected way to manage django plugin development? Is there a way to directly work on the files instead of jumping through the installed package in venv/lib/pythonxxx/site-packages/?

@jheld
Copy link
Collaborator

jheld commented Sep 30, 2022

Hi,

I usually install the project in editable mode python -m pip install -e . , which would at least get around the issue of where certain things live at all :) but to your question about the migrations creation:

I think I create migrations from the root but I specify the project settings folder e xplicitly (perhaps against the test projects settings). It has been awhile since I've created a migration PR but at least right now in my head that's what I would do. So, correct, no need to copy anything if running it via the way I have pseudo-written out.

@jheld jheld merged commit 2f0798f into soynatan:master Jan 26, 2023
@3cp 3cp deleted the dev-requestevent-datetime-index branch March 8, 2023 08:08
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 this pull request may close these issues.

Poor performance due to datetime column is not indexed
2 participants