Skip to content

Commit

Permalink
Remove most indexes from changesets table (#621)
Browse files Browse the repository at this point in the history
  • Loading branch information
willemarcel authored Sep 20, 2022
1 parent d33766a commit 24f0cf7
Show file tree
Hide file tree
Showing 2 changed files with 86 additions and 13 deletions.
73 changes: 73 additions & 0 deletions osmchadjango/changeset/migrations/0057_auto_20220920_1423.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# Generated by Django 2.2.28 on 2022-09-20 14:23

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('changeset', '0056_auto_20220429_1305'),
]

operations = [
migrations.AlterField(
model_name='changeset',
name='checked',
field=models.BooleanField(default=False),
),
migrations.AlterField(
model_name='changeset',
name='comment',
field=models.CharField(blank=True, max_length=1000, null=True),
),
migrations.AlterField(
model_name='changeset',
name='comments_count',
field=models.IntegerField(default=0, null=True),
),
migrations.AlterField(
model_name='changeset',
name='create',
field=models.IntegerField(null=True),
),
migrations.AlterField(
model_name='changeset',
name='delete',
field=models.IntegerField(null=True),
),
migrations.AlterField(
model_name='changeset',
name='editor',
field=models.CharField(blank=True, max_length=255, null=True),
),
migrations.AlterField(
model_name='changeset',
name='harmful',
field=models.NullBooleanField(),
),
migrations.AlterField(
model_name='changeset',
name='imagery_used',
field=models.CharField(blank=True, max_length=1000, null=True),
),
migrations.AlterField(
model_name='changeset',
name='is_suspect',
field=models.BooleanField(),
),
migrations.AlterField(
model_name='changeset',
name='modify',
field=models.IntegerField(null=True),
),
migrations.AlterField(
model_name='changeset',
name='source',
field=models.CharField(blank=True, max_length=1000, null=True),
),
migrations.AlterField(
model_name='changeset',
name='uid',
field=models.CharField(blank=True, max_length=255, null=True, verbose_name='User ID'),
),
]
26 changes: 13 additions & 13 deletions osmchadjango/changeset/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,29 +60,29 @@ class Meta:

class Changeset(models.Model):
user = models.CharField(max_length=1000, db_index=True)
uid = models.CharField(_('User ID'), max_length=255, blank=True, null=True, db_index=True)
editor = models.CharField(max_length=255, blank=True, null=True, db_index=True)
uid = models.CharField(_('User ID'), max_length=255, blank=True, null=True)
editor = models.CharField(max_length=255, blank=True, null=True)
powerfull_editor = models.BooleanField(_('Powerfull Editor'), default=False)
comment = models.CharField(max_length=1000, blank=True, null=True, db_index=True)
comments_count = models.IntegerField(null=True, db_index=True, default=0)
source = models.CharField(max_length=1000, blank=True, null=True, db_index=True)
imagery_used = models.CharField(max_length=1000, blank=True, null=True, db_index=True)
comment = models.CharField(max_length=1000, blank=True, null=True)
comments_count = models.IntegerField(null=True, default=0)
source = models.CharField(max_length=1000, blank=True, null=True)
imagery_used = models.CharField(max_length=1000, blank=True, null=True)
date = models.DateTimeField(null=True, db_index=True)
reasons = models.ManyToManyField(SuspicionReasons, related_name='changesets')
new_features = JSONField(default=list)
reviewed_features = JSONField(default=list)
tag_changes = JSONField(default=dict)
create = models.IntegerField(db_index=True, null=True)
modify = models.IntegerField(db_index=True, null=True)
delete = models.IntegerField(db_index=True, null=True)
create = models.IntegerField(null=True)
modify = models.IntegerField(null=True)
delete = models.IntegerField(null=True)
bbox = models.PolygonField(null=True)
area = models.FloatField(blank=True, null=True)
is_suspect = models.BooleanField(db_index=True)
harmful = models.NullBooleanField(db_index=True)
is_suspect = models.BooleanField()
harmful = models.NullBooleanField()
tags = models.ManyToManyField(Tag, related_name='changesets')
checked = models.BooleanField(default=False, db_index=True)
checked = models.BooleanField(default=False)
check_user = models.ForeignKey(
User, on_delete=models.SET_NULL, null=True, blank=True, db_index=True
User, on_delete=models.SET_NULL, null=True, blank=True
)
check_date = models.DateTimeField(null=True, blank=True)
metadata = JSONField(default=dict)
Expand Down

0 comments on commit 24f0cf7

Please sign in to comment.