Added indexes for ownerId and ownerSource fields in charts model

This commit is contained in:
Evgeniy Timokhov 2020-01-28 12:26:30 +03:00
parent 27db8fc081
commit d8a57080a3
2 changed files with 28 additions and 3 deletions

View File

@ -0,0 +1,25 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.27 on 2020-01-28 08:40
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('model', '0004_studytemplate'),
]
operations = [
migrations.AlterField(
model_name='chart',
name='ownerId',
field=models.CharField(db_index=True, max_length=200),
),
migrations.AlterField(
model_name='chart',
name='ownerSource',
field=models.CharField(db_index=True, max_length=200),
),
]

View File

@ -3,8 +3,8 @@ from jsonfield import JSONField
class Chart(models.Model):
ownerSource = models.CharField(max_length=200)
ownerId = models.CharField(max_length=200)
ownerSource = models.CharField(max_length=200, db_index=True)
ownerId = models.CharField(max_length=200, db_index=True)
name = models.CharField(max_length=200)
symbol = models.CharField(max_length=50)
resolution = models.CharField(max_length=10)
@ -28,4 +28,4 @@ class StudyTemplate(models.Model):
return self.ownerSource + ":" + self.ownerId
def setContent(self, _content):
self.content = _content
self.content = _content