0

I have the following model:

class Transaction(models.Model):
    deviceId = models.CharField(max_length=32, db_index=True)
    transactionTime = models.DateTimeField(db_index=True)

    class Meta:
        index_together = [
    ["deviceId", "transactionTime"],
    ]

When I issue the sql command on the app: python manage.py sql device

I get only the table create statement and no index create statements.

Is there something I am doing wrong?

1 Answer 1

3

You need to use "sqlall":

python manage.py sqlall device
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.