fix: add index on clickers
This commit is contained in:
parent
114f054c0b
commit
3a95e4c61b
2
Makefile
2
Makefile
|
@ -15,7 +15,7 @@ docker-run-dev: ## Runs dev server in docker
|
|||
|
||||
docker-run-production: ## Runs production server in docker
|
||||
poetry run python3 manage.py migrate
|
||||
poetry run gunicorn vas3k_blog.asgi:application -w 7 -k uvicorn.workers.UvicornWorker --bind=0.0.0.0:8022 --capture-output --log-level debug --access-logfile - --error-logfile -
|
||||
poetry run gunicorn vas3k_blog.asgi:application -w 5 -k uvicorn.workers.UvicornWorker --bind=0.0.0.0:8022 --capture-output --log-level debug --access-logfile - --error-logfile -
|
||||
|
||||
help: ## Display this help
|
||||
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) \
|
||||
|
|
|
@ -0,0 +1,30 @@
|
|||
# Generated by Django 4.1.5 on 2023-01-12 11:50
|
||||
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("comments", "0003_alter_comment_options_alter_comment_created_at_and_more"),
|
||||
("clickers", "0002_initial"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name="clicker",
|
||||
name="block",
|
||||
field=models.TextField(db_index=True),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="clicker",
|
||||
name="comment",
|
||||
field=models.ForeignKey(
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.SET_NULL,
|
||||
related_name="clickers",
|
||||
to="comments.comment",
|
||||
),
|
||||
),
|
||||
]
|
|
@ -3,8 +3,8 @@ from django.db import models
|
|||
|
||||
class Clicker(models.Model):
|
||||
post = models.ForeignKey("posts.Post", related_name="clickers", on_delete=models.CASCADE)
|
||||
comment = models.ForeignKey("comments.Comment", related_name="clickers", null=True, on_delete=models.CASCADE)
|
||||
block = models.TextField()
|
||||
comment = models.ForeignKey("comments.Comment", related_name="clickers", null=True, on_delete=models.SET_NULL)
|
||||
block = models.TextField(db_index=True)
|
||||
created_at = models.DateTimeField(auto_now_add=True)
|
||||
ipaddress = models.GenericIPAddressField(db_index=True)
|
||||
useragent = models.CharField(max_length=256)
|
||||
|
|
|
@ -6,6 +6,5 @@ class NotificationsConfig(AppConfig):
|
|||
name = "notifications"
|
||||
|
||||
def ready(self):
|
||||
pass
|
||||
# register signals here
|
||||
from notifications.signals.comments import create_comment # NOQA
|
||||
|
|
Loading…
Reference in New Issue