stats
This commit is contained in:
13
stats/models.py
Normal file
13
stats/models.py
Normal file
@@ -0,0 +1,13 @@
|
||||
from django.db import models
|
||||
from django.utils import timezone
|
||||
|
||||
|
||||
class Snapshot(models.Model):
|
||||
data = models.JSONField()
|
||||
project = models.ForeignKey('web.Project', on_delete=models.CASCADE)
|
||||
created_at = models.DateTimeField(default=timezone.now)
|
||||
|
||||
class Meta:
|
||||
indexes = [
|
||||
models.Index(fields=['project', '-created_at'])
|
||||
]
|
Reference in New Issue
Block a user