Closed Niqnil closed 2 years ago
Your way of using abstract seems a bit wierd to be. Do you actually create another model that inherits from the abstracted model? Anyway, not related to this lib so closing for now. Good luck
I was getting a similar error when trying to use timescaledb for an existing model. I ended up disabling index on my foreign key (not using it as column / space partition, so db_index=False
) and explicitly defining indexes
in the model's meta. Rearranging the output from makemigrations
might also have helped.
In my case, I tried creating a unique constraint on a field without including the time
field:
models.UniqueConstraint(fields=('token',), name='unique_token_ranks_current')
and I got this error. Adding the time
field made the error go away, although I don't think it will behave how I want:
models.UniqueConstraint(fields=('token', 'time'), name='unique_token_time_ranks_current')
This would allow the same token to appear twice with different timestamps, but I only want one of each token. I tried adding both constraints but still got the error.
I'm a newbie trying to use timescaledb with my django project. I'm having trouble running the initial migration despite trying the two implementation methods listed in point 3 of your quickstart. From the traceback, it looks like a problem with userauth.models.CustomUser, which inherits from core.models.CreationModificationDateBase, which inherits TimescaleDateTimeField/TimescaleModel. I can't figure out what I'm missing so I'm hoping to get some help.