Skip to content

Commit

Permalink
Use Charfield instead of TextField to support MySQL index
Browse files Browse the repository at this point in the history
  • Loading branch information
victorx98 committed Nov 11, 2016
1 parent d8e2237 commit efc2350
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion rest_framework_tracking/migrations/0001_initial.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class Migration(migrations.Migration):
('remote_addr', models.GenericIPAddressField()),
('host', models.URLField()),
('method', models.CharField(max_length=10)),
('query_params', models.TextField(db_index=True)),
('query_params', models.CharField(max_length=2048, db_index=True)),
('data', models.TextField(null=True, blank=True)),
('response', models.TextField(null=True, blank=True)),
('user', models.ForeignKey(blank=True, to=settings.AUTH_USER_MODEL, null=True)),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ class Migration(migrations.Migration):
migrations.AlterField(
'APIRequestLog',
'query_params',
models.TextField(db_index=True, null=True, blank=True),
models.CharField(max_length=2048, db_index=True, null=True, blank=True),
),
]
2 changes: 1 addition & 1 deletion rest_framework_tracking/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class BaseAPIRequestLog(models.Model):
method = models.CharField(max_length=10)

# query params
query_params = models.TextField(db_index=True, null=True, blank=True)
query_params = models.CharField(max_length=2048, db_index=True, null=True, blank=True)

# POST body data
data = models.TextField(null=True, blank=True)
Expand Down

0 comments on commit efc2350

Please sign in to comment.