Compare commits

..

2 Commits

Author SHA1 Message Date
Gokuldevx cd1c3d0ff7 comment model fixed 2026-02-02 17:34:09 +05:30
Gokuldevx 219c6d359a bug resolved 2026-02-02 12:42:22 +05:30
4 changed files with 48 additions and 1 deletions
Binary file not shown.
@@ -0,0 +1,47 @@
# Generated by Django 5.2.5 on 2026-02-02 06:27
import django.core.validators
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0002_user_banned_until_user_is_banned'),
]
operations = [
migrations.AlterUniqueTogether(
name='vote',
unique_together=set(),
),
migrations.AlterField(
model_name='issue',
name='photo',
field=models.ImageField(blank=True, null=True, upload_to='issues/', validators=[django.core.validators.FileExtensionValidator(['jpg', 'jpeg', 'png', 'webp'])]),
),
migrations.AddIndex(
model_name='issue',
index=models.Index(fields=['status'], name='core_issue_status_2609e6_idx'),
),
migrations.AddIndex(
model_name='issue',
index=models.Index(fields=['created_at'], name='core_issue_created_50e100_idx'),
),
migrations.AddIndex(
model_name='issue',
index=models.Index(fields=['department'], name='core_issue_departm_5c654b_idx'),
),
migrations.AddIndex(
model_name='issue',
index=models.Index(fields=['reporter'], name='core_issue_reporte_3f70e1_idx'),
),
migrations.AddConstraint(
model_name='department',
constraint=models.UniqueConstraint(fields=('admin',), name='unique_department_admin'),
),
migrations.AddConstraint(
model_name='vote',
constraint=models.UniqueConstraint(fields=('user', 'issue'), name='unique_vote_per_user_issue'),
),
]
+1 -1
View File
@@ -197,7 +197,7 @@ class Vote(models.Model):
class Comment(models.Model): class Comment(models.Model):
issue = models.ForeignKey(Issue, on_delete=models.CASCADE, related_name="comments") issue = models.ForeignKey(Issue, on_delete=models.CASCADE, related_name="comments")
user = models.ForeignKey(User, on_delete=models.CASCADE) user = models.ForeignKey(User, on_delete=models.CASCADE)
content = models.TextField() # <--- field name is "content", not "text" content = models.TextField()
parent = models.ForeignKey("self", null=True, blank=True, related_name="replies", on_delete=models.CASCADE) parent = models.ForeignKey("self", null=True, blank=True, related_name="replies", on_delete=models.CASCADE)
created_at = models.DateTimeField(auto_now_add=True) created_at = models.DateTimeField(auto_now_add=True)